Andrew Sherman has uploaded a new patch set (#6). ( 
http://gerrit.cloudera.org:8080/22186 )

Change subject: IMPALA-13335: ignore duplicate ‘X-Forwarded-For’ headers
......................................................................

IMPALA-13335: ignore duplicate ‘X-Forwarded-For’ headers

When using the hs2-http protocol, Impala clients communicate with Impala
by sending and receiving http messages. In a modern deployment
environment like Kubernetes these http messages may travel through a
series of http proxies. These proxies may record information about the
path through the system in one or more ‘X-Forwarded-For’ http headers.
At present Impala uses this header in various ways, (1) to skip
Authentication for connection from a trusted domain, and (2) to record
information about the origin of a query in the runtime profile.

If there are multiple copies of the ‘X-Forwarded-For’ header then
Impala should only use the first of these headers that it sees.
For reference see details in
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For

We have to be careful to reset the 'origin_' field in THttpServer after
headers have been processed. This allows the field to reused when a new
HTTP message is processed. As part of this a variable in
headersDone() is renamed to avoid multiple variables called 'origin'.

TESTING

Add a new test which uses a new Impyla mechanism from release 0.21a1 to
add multiple headers to its http messages.

Change-Id: Iee7b452842aa391d285bd445d6a9e6cbbedd7fbb
---
M be/src/transport/THttpServer.cpp
M tests/hs2/test_hs2.py
2 files changed, 42 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/86/22186/6
--
To view, visit http://gerrit.cloudera.org:8080/22186
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iee7b452842aa391d285bd445d6a9e6cbbedd7fbb
Gerrit-Change-Number: 22186
Gerrit-PatchSet: 6
Gerrit-Owner: Andrew Sherman <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Andrew Sherman <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>

Reply via email to