[ 
https://issues.apache.org/jira/browse/KNOX-897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15905387#comment-15905387
 ] 

Sumit Gupta commented on KNOX-897:
----------------------------------

Hmm, not sure [~smore]. I just tried with the 0.12.0 RC and I see this with a 
plain old client request as the outgoing from Knox (I'm looking at the gateway 
log with http wire level debug turned on). There is a config flag in 
gateway-site to turn the x-forwarded population off, but I can't imagine that 
you have set that.

2017-03-10 11:46:16,899 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "GET /webhdfs/v1/?op=LISTSTATUS&user.name=guest HTTP/1.1[\r][\n]"
2017-03-10 11:46:16,900 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "X-Forwarded-For: 127.0.0.1[\r][\n]"
2017-03-10 11:46:16,900 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "X-Forwarded-Proto: https[\r][\n]"
2017-03-10 11:46:16,900 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "X-Forwarded-Port: 8443[\r][\n]"
2017-03-10 11:46:16,901 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "X-Forwarded-Host: localhost:8443[\r][\n]"
2017-03-10 11:46:16,901 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "X-Forwarded-Server: localhost[\r][\n]"
2017-03-10 11:46:16,901 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "X-Forwarded-Context: /gateway/sandbox[\r][\n]"
2017-03-10 11:46:16,902 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "Connection: keep-alive[\r][\n]"
2017-03-10 11:46:16,902 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_66)[\r][\n]"
2017-03-10 11:46:16,902 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "Accept-Encoding: gzip,deflate[\r][\n]"
2017-03-10 11:46:16,903 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "Host: c6401.ambari.apache.org:50070[\r][\n]"
2017-03-10 11:46:16,903 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-0 
>> "[\r][\n]"

> 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)

Reply via email to