Skip to content

Commit

Permalink
RESTWS-649 - Update (openmrs#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
gayanW authored and dkayiwa committed Oct 19, 2017
1 parent 8545932 commit 762cc0f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ public class SwaggerSpecificationController {
public @ResponseBody
String getSwaggerSpecification(HttpServletRequest request) throws Exception {

String host = request.getHeader(HttpHeaders.HOST);

String scheme = request.getHeader(HttpHeaders.X_FORWARDED_PROTO);
if (scheme == null) {
scheme = request.getScheme();
}

return new SwaggerSpecificationCreator()
.host(request.getHeader(HttpHeaders.HOST))
.host(host)
.basePath(request.getContextPath() + "/ws/rest/v1")
.scheme(Scheme.forValue(request.getScheme()))
.scheme(Scheme.forValue(scheme))

.getJSON();
}
Expand Down

0 comments on commit 762cc0f

Please sign in to comment.