ilPittiz opened a new issue, #14090:
URL: https://github.com/apache/grails-core/issues/14090

   ### Expected Behavior
   
   _No response_
   
   ### Actual Behaviour
   
   `WebUtils.retrieveGrailsWebRequest().getBaseUrl()` does not return a 
consistent request base URL when:
   - `X-Forwarded-Proto` request header is defined
   - `X-Forwarded-Port` request header is *not* defined
   
   ### Steps To Reproduce
   
   Example:
   `curl -H 'X-Forwarded-Proto: https' https://my.domain.com/path`
   
   _MyController.groovy_
   ```
   def debug() {
       println WebUtils.retrieveGrailsWebRequest().getBaseUrl()
   }
   ```
   Output: 
   `https://my.domain.com:null`
   
   There's an ambiguous logical expression at
   
https://github.com/apache/grails-core/blob/13617a4a4a78894146f6b3b85b15e1a52e29c5b8/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java#L475-L479
   where
   - `forwardedScheme` = "https"
   - `forwardedPort` = null 
   
   The `if` statement is in the form of `A && B || C`, while it should be `A && 
(B || C)`, as `forwardedPort` is indeed null.
   
   ### Environment Information
   
   Not relevant
   
   ### Example Application
   
   _No response_
   
   ### Version
   
   Issue found on Grails 6.x


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to