Output from http://api.drupal.org/api/function/drupal_get_headers/6 when 404 is different
Pressflow
content-type: text/html; charset=utf-8
:status: 404 Not Found
Drupal
Content-Type: text/html; charset=utf-8
HTTP/1.1 404 Not Found
Looks like I need to fix these functions
function _boost_get_http_status($default = 200) {
static $regex = '!^HTTP/1.1\s+(\d+)!';
return (int)_boost_get_http_header($regex, $default);
}
function _boost_get_http_header($regex, $default = NULL) {
// The last header is the one that counts:
$headers = preg_grep($regex, explode("\n", drupal_get_headers()));
if (!empty($headers) && preg_match($regex, array_pop($headers), $matches)) {
return $matches[1]; // found it
}
return $default; // no such luck
}
NOTE: both do not say 200 when successful so the default needs to be 200.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | boost-585330.patch | 1.82 KB | mikeytown2 |
| #1 | boost-585204.patch | 2.71 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 commentedComment #2
mikeytown2 commentedWrong issue
Comment #3
mikeytown2 commentedcommitted
Comment #5
crea commentedwould be funny if you said "committed, thanks!" :-P