mod_proxy (rev proxy): Don't set Content-Type if remote server doesn't set it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to troubleshoot a Nokia E71x having problems connecting to
our OWA server via an Apache 2.2.13 reverse proxy.

As part of the troubleshooting, I noticed that in response to a Sync
request (all done via HTTP/1.1 btw), we recieve a response from the OWA
server with the following HTTP characteristics:

  HTTP/1.1 200 OK
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Transfer-Encoding: chunked

  <chunked response>

However, when Apache transmits this back to the client, the response
looks like this:

  HTTP/1.1 200 OK
  Date: Thu, 28 Jan 2010 01:18:30 GMT
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Transfer-Encoding: chunked
  Content-Type: text/plain; charset=UTF-8

  <chunked response>

I have tested with and without the Apache server in the middle, and
only get errors on the Nokia with the proxy in place.  The above packet
is the only difference I can detect between the two.

(The Nokia device doesn't appear to sync at all if I force HTTP/1.0 as
it always tranmits an "Expect: 100-continue" header and this elicits a
"go away" response from the Apache server as this isn't valid for
HTTP/1.0 -- basically we're dealing with a broken HTTP client on the
Nokia)

I'd like to tell Apache to *not* insert the extra headers if they're
not in the packet coming from the IIS server... I don't care so much
about the Date header, but I really want to strip out the Content-Type
header....

Obviously I could do something like the following:

  <Location /Microsoft-Server-ActiveSync>
    ProxyPass https://owa.esri.com/Microsoft-Server-ActiveSync
    ProxyPassReverse https://owa.esri.com/Microsoft-Server-ActiveSync
    Header unset Content-Type
  </Location>

However, this strips out the Content-Type for *all* requests.  I just
want to leave the response packet alone and not add the Content-Type
header if it's missing.

I don't see a way to base a Header unset on a environment variable
(apparently this is only for the "set", "echo" keywords).

I might be able to limit the scope of the Header unset by doing some
mod_rewrite trickery if I can track down the exact type of ActiveSync
request that triggers this particular response..... I'd rather have a
more general solution though.

Any ideas?

Thanks,
Ray

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux