How to remove X-Forwarded-For

Asked by joseph jose on 2014-07-08

I want to Remove X-Forwarded-For from my http request. could you please tell me how to do it using ecap?

Question information

Language:
English Edit question
Status:
Answered
For:
eCAP Edit question
Assignee:
No assignee Edit question
Last query:
2014-07-08
Last reply:
2014-07-08
Alex Rousskov (rousskov) said : #1

If you want to remove X-Forwarded-For received by the host application, then a pre-cache REQMOD service may suffice. Clone the virgin request and use the libecap::Header::removeAny() method to remove the offending header from the cloned/adapted message. Do not forget that request may have bodies and that adapters modifying headers are currently responsible for body delivery to the host application.

If you want to remove X-Forwarded-For added by the host application before forwarding the request to the next HTTP hop, then you need to make sure your host application supports post-cache REQMOD adaptation services and lets them have the last word. For example, Squid does not support post-cache REQMOD.

Any decent host application using and/or adding X-Forwarded-For should have a knob to disable those features. Investigate them before writing any adapter code because such native support is usually more efficient and may support vectoring points where there is no eCAP support. For example, Squid has forwarded_for and follow_x_forwarded_for configuration directives.

joseph jose (joevypana) said : #2

Thanks Alex for your reply.. i will try it out

Can you help with this problem?

Provide an answer of your own, or ask joseph jose for more information if necessary.

To post a message you must log in.