Remove Accept-Encoding from request

Asked by gianni

Hallo,

It's possible to remove some header of some (or all) request?

In particular I'd like to suppress the:
Accept-Encoding: gzip,deflate
that the standard browser send to web server...

Can someone print out an example?

I'm currently working on adapter_modifing.cc with libecap-0.2.0 and last squid version...

Question information

Language:
English Edit question
Status:
Answered
For:
eCAP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alex Rousskov (rousskov) said :
#1

Yes, it is possible and fairly easy to do. The Modifying Adapter shows how to add a header using libecap::Header::add(). Use the libecap::Header::removeAny() method to remove the header(s) you want.

Revision history for this message
Alex Rousskov (rousskov) said :
#2

And keep in mind that your host application such as Squid may have facilities to suppress request headers as well. If header removal is the only goal, you may not need an adapter.

Revision history for this message
gianni (gianni-olivieri) said :
#3

Ok, I'll try... but to remove

Accept-Encoding (for example)

it's ok:

libecap::Header::removeAny('Accept-Encoding')????

Revision history for this message
Alex Rousskov (rousskov) said :
#4

Not exactly, but if you look at how the Modifying Adapter adds a header, you should be able to remove headers using very similar code.

Revision history for this message
Danny (penkween) said :
#5

Hi Gianni,

Are you able to remove the Request Header [Accept-Encoding] , mind to share how to do it ?

Thanks a lot.

Can you help with this problem?

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

To post a message you must log in.