0

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="(.*)" />
    <conditions>
      <add input="{HTTP_ACCEPT_ENCODING}" pattern="gfe" />
    </conditions>
    <serverVariables>
      <set name="HTTP_ACCEPT_ENCODING" value="gzip" />
    </serverVariables>
    <action type="None" />
  </rule>

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?

Nariman
  • 229
  • 3
  • 10

0 Answers0