code review feedback
This commit is contained in:
parent
cb374042f5
commit
4051fe0849
|
@ -343,7 +343,7 @@ public class OpenApiInterceptor {
|
|||
String page = extractPageName(theRequestDetails, PAGE_SYSTEM);
|
||||
context.setVariable("PAGE", page);
|
||||
|
||||
populateOIDCVariables(context);
|
||||
populateOIDCVariables(theRequestDetails, context);
|
||||
|
||||
String outcome = myTemplateEngine.process("index.html", context);
|
||||
|
||||
|
@ -351,8 +351,8 @@ public class OpenApiInterceptor {
|
|||
theResponse.getWriter().close();
|
||||
}
|
||||
|
||||
protected void populateOIDCVariables(WebContext context) {
|
||||
context.setVariable("OAUTH2_REDIRECT_URL_PROPERTY", "");
|
||||
protected void populateOIDCVariables(ServletRequestDetails theRequestDetails, WebContext theContext) {
|
||||
theContext.setVariable("OAUTH2_REDIRECT_URL_PROPERTY", "");
|
||||
}
|
||||
|
||||
private String extractPageName(ServletRequestDetails theRequestDetails, String theDefault) {
|
||||
|
|
|
@ -213,6 +213,17 @@ public class OpenApiInterceptorTest {
|
|||
assertEquals(null, url);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStandardRedirectScriptIsAccessible() throws IOException {
|
||||
myServer.getRestfulServer().registerInterceptor(new AddResourceCountsInterceptor());
|
||||
myServer.getRestfulServer().registerInterceptor(new OpenApiInterceptor());
|
||||
|
||||
HttpGet get = new HttpGet("http://localhost:" + myServer.getPort() + "/fhir/swagger-ui/oauth2-redirect.html");
|
||||
try (CloseableHttpResponse response = myClient.execute(get)) {
|
||||
assertEquals(200, response.getStatusLine().getStatusCode());
|
||||
}
|
||||
}
|
||||
|
||||
private String fetchSwaggerUi(String url) throws IOException {
|
||||
String resp;
|
||||
HttpGet get = new HttpGet(url);
|
||||
|
|
Loading…
Reference in New Issue