Skip to content

Commit

Permalink
Auth url base change
Browse files Browse the repository at this point in the history
  • Loading branch information
bstewartlg committed Jun 28, 2024
1 parent 796b265 commit 4f4abbf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ private CapabilityStatementRestSecurityComponent getSecurity(HttpServletRequest
CapabilityStatementRestSecurityComponent security = new CapabilityStatementRestSecurityComponent();
security.setCors(true);
Extension oauthUris = new Extension("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris");
String uriBase = request.getRequestURL().toString().replace(request.getRequestURI(), "");
String uriBase = request.getScheme() + "://" + request.getServerName()
+ ("http".equals(request.getScheme()) && request.getServerPort() == 80
|| "https".equals(request.getScheme()) && request.getServerPort() == 443 ? ""
: ":" + request.getServerPort());

if (System.getenv("TOKEN_BASE_URI") != null && !System.getenv("TOKEN_BASE_URI").isBlank()) {
uriBase = System.getenv("TOKEN_BASE_URI");
}
Expand Down

0 comments on commit 4f4abbf

Please sign in to comment.