Hi,
We're running googleanalytics on a Pressflow 6 installation. One of the changes Pressflow makes is to drupal_set_header(), to make sure that Drupal responds with the correct HTTP version for what it was requested on (HTTP/1.0 or HTTP/1.1). Unfortunately googleanalytics searches explicitly in the headers for "HTTP/1.1 404 Not Found", but Pressflow actually stores this as ":status: 404 Not Found", so it doesn't match.
I've patched the module to simply ignore the HTTP/1.1 bit and just match on the "404 Not Found" part, which works.
I don't imagine it has any adverse effects on stock Drupal.
Thanks
Comment | File | Size | Author |
---|---|---|---|
googleanalytics.module.pressflow.patch | 1.21 KB | neilnz | |
Comments
Comment #1
hass CreditAttribution: hass commentedSounds like a bug in pressflow! Do you know why pressflow change the headers and why it adds the ":status:"?
Comment #2
neilnz CreditAttribution: neilnz commentedAs mentioned, it does it so that it's not fixed to writing "HTTP/1.1" as the HTTP version. Because Pressflow is designed to work well behind caching proxies like Nginx or Varnish, which usually make requests over HTTP/1.0, it needs to reply with an "HTTP/1.0" header to those, so instead of calculating which version to use when the header is set, it substitutes in the correct version when it writes the headers out, using a ":status:" placeholder in between.
Since we use nginx as a proxy in front of Apache, the actual error that Pressflow outputs is "HTTP/1.0 404 Not Found".
Comment #3
hass CreditAttribution: hass commentedPatch does not apply.
Comment #4
hass CreditAttribution: hass commentedCommitted to D5 and D6. There is no need to port to D7+.