symfony: Forwarded header not used in Request::getPort() and Request::getScheme()
Description
If I’m not wrong, the Forwarded header is not being used to detect the port and scheme of the request.
As the documentation does not state any of this, I’m not sure if this would be a bug, a documentation error, or a feature request:

Example
As for a header like for=xx.xx.xxx.xx;proto=https;host=xxxxxxxxxxx.localhost.run, the Router component generates absolute URLs with the correct host, but the schema is set to http.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (12 by maintainers)
@xabbuh this is a valid request. The code of HttpFoundation is indeed not supporting
ForwardedingetPortandisSecurebut only theX-Forwarded-*header. When implementing support forForwarded, it was done in an incomplete way, considering that it is a standard replacement forX-Forwarded-Foronly, while it is meant to replace all theX-Forwarded-*headers of the de-facto standard.IIRC I was able to reproduce this locally. I will try to find some time to look into it again.
Indeed, @stof is right here.
isSecure()only considers theX-Forwarded-Protoheader.