[
https://issues.apache.org/jira/browse/KNOX-897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15905377#comment-15905377
]
Sandeep More commented on KNOX-897:
-----------------------------------
Hello [~sumit.gupta],
I did a quick test (with the patch applied) and it does not appear that Knox
adds X-Forwarded-* headers if none are specified in the request.
e.g.
Snippet from gateway.log for:
1. Request with client specifying X-Forwarded-Host and X-Forwarded-Proto headers
{code}
Header[Authorization]=Basic
Header[Accept]=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Header[Upgrade-Insecure-Requests]=1
Header[Connection]=keep-alive
Header[User-Agent]=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Header[X-Forwarded-Host]=www.local.com
Header[X-Forwarded-Proto]=https
Header[Host]=www.local.com:8443
Header[Accept-Encoding]=gzip, deflate, sdch, br
Header[Accept-Language]=en-US,en;q=0.8
{code}
2. Request with client not-specifying X-Forwarded-Host and X-Forwarded-Proto
headers
{code}
Header[Authorization]=Basic
Header[Cookie]=JSESSIONID=epsa9ityqvvx1dbbw9yiopgb2
Header[Accept]=*/*
Header[X-Requested-With]=XMLHttpRequest
Header[Connection]=keep-alive
Header[User-Agent]=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Header[Referer]=https://www.local.com:8443/gateway/sandbox/hdfs/
Header[Host]=www.local.com:8443
Header[Accept-Encoding]=gzip, deflate, sdch, br
Header[Accept-Language]=en-US,en;q=0.8
{code}
It could be possible I might have missed something :)
> X-Forwarded-Port is incorrectly determined
> ------------------------------------------
>
> Key: KNOX-897
> URL: https://issues.apache.org/jira/browse/KNOX-897
> Project: Apache Knox
> Issue Type: Bug
> Affects Versions: 0.11.0
> Reporter: Attila Kanto
> Fix For: 0.12.0
>
> Attachments: gateway.log, knox-897.patch, Screen Shot 2017-03-01 at
> 14.44.03.png
>
>
> If the client fills out the following headers:
> {code}
> Header[X-Forwarded-Host]=local.somehost.com
> Header[X-Forwarded-Proto]=https
> {code}
> And does not specify the port number in X-Forwarded-Host since it uses the
> the default port, then Knox automatically populates X-Forwarded-Port header
> field with its own local port e.g. 8443 instead of the default 443 which
> results in page not founds (see screenshot and log).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)