You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you please provide a sample application? There are numerous configuration settings in spring that control the proxy behavior & headers. A sample application would make sure we address this issue properly.
We identified this bug right after our IT team moved all microservices to Cloudfare CDN, that by default adds X-Forwarded-Proto header to all requests, while does not add X-Forwarded-Port header.
Expected Behavior
No response
Actual Behaviour
WebUtils.retrieveGrailsWebRequest().getBaseUrl()
does not return a consistent request base URL when:X-Forwarded-Proto
request header is definedX-Forwarded-Port
request header is not definedSteps To Reproduce
Example:
curl -H 'X-Forwarded-Proto: https' https://my.domain.com/path
MyController.groovy
Output:
https://my.domain.com:null
There's an ambiguous logical expression at
grails-core/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java
Lines 475 to 479 in 13617a4
where
forwardedScheme
= "https"forwardedPort
= nullThe
if
statement is in the form ofA && B || C
, while it should beA && (B || C)
, asforwardedPort
is indeed null.Environment Information
Not relevant
Example Application
No response
Version
Issue found on Grails 6.x
The text was updated successfully, but these errors were encountered: