Skip to content

Commit

Permalink
Update GrailsWebRequest
Browse files Browse the repository at this point in the history
to read the PORT information from the request header when it is missing
in the request. This fixes #12816 where application is accesed via
AWS's ALB.
  • Loading branch information
puneetbehl committed Nov 6, 2023
1 parent 82181d6 commit 4265630
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public String getBaseUrl() {
StringBuilder sb=new StringBuilder();
sb.append(scheme).append("://").append(request.getServerName());

int port = request.getServerPort();
int port = request.getServerPort() ?: request.getHeader("X-Forwarded-Port");

//ignore port append if the request was forwarded from a VIP as actual source port is now not known
if (forwardedScheme == null && (("http".equals(scheme) && port != 80) || ("https".equals(scheme) && port != 443))) {
Expand Down

0 comments on commit 4265630

Please sign in to comment.