1

Just launched a new AngluarJs mobile site that passed developer and QA testing and now live a small percentage of users are getting errors(could not find expected value).

Tracked this down to Android Chrome users that have the "Reduce Data Usage" setting toggled ON which then routes requests through Google's data compression proxy.

The reason this is generating an error is that the server does not receive the custom http header that is passed from the client. We can clearly see that the Google proxy is stripping it.

How can we stop Google's proxy stripping custom headers and is this expected behaviour? I could not find anything related in the developer Docs.

rob
  • 8,134
  • 8
  • 58
  • 68

1 Answers1

0

Google's Compression Proxy doesn't strip response headers, at least those beginning with X-. See below the response headers of this web page using Compression Proxy:

cache-control: public, max-age=60
content-encoding: gzip
content-length: 15283
content-type: text/html; charset=utf-8
date: Sat, 31 Jan 2015 20:17:30 GMT
expires: Sat, 31 Jan 2015 20:18:30 GMT
last-modified: Sat, 31 Jan 2015 20:17:30 GMT
server: GFE/2.0
status: 200 OK
vary: *
version: HTTP/1.1
via: 1.1 Chrome-Compression-Proxy
x-frame-options: SAMEORIGIN
x-original-content-length: 15283
x-request-guid: 719ab2fb-7f3b-4296-b6fd-497997ffe761

So the possible solution is to use X-SiteHost header name.

niutech
  • 28,923
  • 15
  • 96
  • 106
  • This is a request header from the client. But what you say is interesting as I had just been reading about how the prepended x- is now depreciated by the http://stackoverflow.com/questions/22847182/if-x-custom-header-is-no-longer-supported-deprecated-by-ietf-how-do-we-return and that decision was made back in 2012. Odd if Google is only allowing "x-" headers. – rob Jan 31 '15 at 21:07