Closed (fixed)
Project:
404 Blocks
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2009 at 11:41 UTC
Updated:
9 Aug 2010 at 23:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
mikey_p commentedApparently the headers being checked don't quite match anymore.
Comment #2
jcmarco commented+1
Tested with Apache and CentOS 5.2.
Comment #3
johnalbinHmm… this is the second report of the headers not matching. However, Drupal hard-codes the header, so I'm really confused how you guys are seeing a different header string then what Drupal is putting into drupal_get_headers(). :-\
On 404, drupal sets this header inside drupal_not_found(). http://api.drupal.org/api/function/drupal_not_found/6
What headers are you guys seeing?
See also #371069: Stop hardcoding the HTTP protocol version
Comment #4
jcmarco commentedIn
#2
dema502 - February 11, 2009 - 00:24
I use drupal+apache on backend and ngnix on frontend
-----
He is using an ngnix as a proxy/balancer
In my case I have an HAProxy for balancing load that acts as a proxy.
So it is possible that when you have a proxy the headers are sanitized.
Have the other guys in this issue some balancer/proxy/cache... in front of drupal?
Comment #5
nunami commentedMy site is returning the following 404 header:
Content-Type: text/html; charset=utf-8 HTTP/1.1 404 Not Found
edit: I've made the changes myself
while I can confirm that the if statement returns true but $vars['show_blocks'] = TRUE; doesn't display my right region.
Am I missing something?
Comment #6
rjbrown99 commented+1, the headers were not matching for me. I'm using Pressflow, not sure if that matters or not. I know they do a bit of header manipulation to make things behave properly for reverse proxies.
Here's my fix.
Comment #7
johnalbinOoooh. You're using Pressflow. Hmm… I wonder if they've patched that part of Drupal that I'm relying on. Is Drupal core's hard-coded value in drupal_not_found() is not the same as Pressflow's drupal_not_found()?
Hmm… nope. Pressflow still hard-codes the string I'm looking for in this module.
drupal_set_header('HTTP/1.1 404 Not Found');See http://bazaar.launchpad.net/~pressflow/pressflow/6/annotate/head:/includ...AHA! Pressflow's drupal_set_header() is hacked to strip out the first 9 characters of any header starting with "HTTP/1.". See http://bazaar.launchpad.net/~pressflow/pressflow/6/annotate/head:/includ...
Okay. Now that I finally understand what is going on, I have no problem committing a fix for it!
Comment #8
johnalbinCommitted the patch by mikey_p. Thanks for all the help, everyone! I really didn't understand what was going on until Robert said "I'm using Pressflow, not sure if that matters or not". It sure did matter! :-D
Comment #9
davidwhthomas commentedHad same issue here using Nginx proxy which uses a HTTP 1.0 client.
fixed it.
DT