Google's PageSpeed Service forwards requests with the accept-encoding header set to gzip(gfe). Unfortunately IIS chokes on this with the following:

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 11 Apr 2014 02:19:39 GMT
Connection: close
Content-Length: 311

Here's the full request:

OPTIONS http://localhost/stream/tags HTTP/1.1
Accept-Encoding: gzip(gfe)
Content-Length: 0

HTTPERR log just lists 400 Bad Request with no additional fields.

I've experimented with changing this value using URL rewrite module:

  <rule name="Accept Encoding Rewrite PageSpeed" stopProcessing="true">
    <match url="(.*)" />
      <add input="{HTTP_ACCEPT_ENCODING}" pattern="gfe" />
      <set name="HTTP_ACCEPT_ENCODING" value="gzip" />
    <action type="None" />

But I'm affraid that the rewrite rules are running after whatever generates the 400.

And also with AllowWeakHeaderValueSyntax mentioned at http://forums.iis.net/p/1176719/1976075.aspx

Any ideas for how to remap accept-encoding to gzip without using another appliance?

  • What does the HTTPERR log entry say for these failed requests? Can you post the full request header, too? – Evan Anderson Apr 11 '14 at 3:07
  • @EvanAnderson updated, not much there, unfortunately. – Nariman Apr 11 '14 at 13:59

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.