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)
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

JohnAlbin - February 10, 2009 - 07:29
Status:needs review» postponed (maintainer needs more info)

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

dema502 - February 10, 2009 - 23:24

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

JohnAlbin - June 29, 2009 - 19:30

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? :-\

 
 

Drupal is a registered trademark of Dries Buytaert.