Stop hardcoding the HTTP protocol version
dema502 - February 8, 2009 - 15:18
| Project: | 404 Blocks |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
some my fixes
function blocks404_preprocess_page(&$vars, $hook) {
- if (strpos(drupal_get_headers(), 'HTTP/1.1 404 Not Found') !== FALSE) {
+ if (strpos(drupal_get_headers(), $_SERVER['SERVER_PROTOCOL'].' 404 Not Found') !== FALSE) {
module_load_include('inc', 'blocks404', 'blocks404.active');
_blocks404_preprocess_page($vars);
}
#1
Its hardcoded in Drupal core: http://api.drupal.org/api/function/drupal_not_found/6
So I have to search for the exact same string in my module.
This doesn't appear to be a bug. Why would your implementation be better than hardcoding "HTTP/1.1"?
#2
I use drupal+apache on backend and ngnix on frontend
Nginx request apache by HTTP/1.0 protocol and this check (strpos(drupal_get_headers(), 'HTTP/1.1 404 Not Found') is not working.
#3
But as I said, Drupal hard codes that string in http://api.drupal.org/api/function/drupal_not_found/6
This module just looks for that string. How is that your system doesn't have the string that Drupal hard-coded into the headers? :-\