Get Squid to pass X-Requested-With header

configurationhttp-headersPROXYsquid

I have configured a squid 3.1 proxy server.
Everything works great except for the X-Requested-With header.
I can't manage to figure out how to pass that header to the site I'm attempting to open via the proxy.

This is my current configuration:

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Cookie allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access User-Agent allow all
request_header_access All deny all #remove all other headers


# delete "x-forwarder-for.." headers
forwarded_for delete
request_header_access Via deny all
request_header_access X-Forwarded-For deny all

I tried to add this line request_header_access X-Requested-With allow all to the configuration but apparently X-Requested-With is an unknown header name…
Apparently I'm missing something?

Best Answer

request_header_access requires --enable-http-violations to be specified when you build squid. Check its presence.

Update

Also the documentation states:

By default, all headers are allowed (no anonymizing is performed).

This means that if a header is not listed anyhow then squid should pass it transparently.

Update

If you have some anonymizing set up then you should put all 'allow' rules before 'All deny All' rule

Related Topic