Skip to content

Commit

Permalink
Make PHP match C code.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 31, 2008
1 parent fb4eefe commit c8d9853
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions offload.php
Expand Up @@ -467,8 +467,15 @@ function debugInit()
if (sanestrpos($Guri, '?') >= 0)
failure('403 Forbidden', "Offload server doesn't do dynamic content.");

if ((strcasecmp($_SERVER['REQUEST_METHOD'], 'GET') != 0) &&
(strcasecmp($_SERVER['REQUEST_METHOD'], 'HEAD') != 0))
$reqmethod = $_SERVER['REDIRECT_REQUEST_METHOD'];
if (!isset($reqmethod)
$reqmethod = $_SERVER['REQUEST_METHOD'];
if (!isset($reqmethod)
$reqmethod = 'GET';
$ishead = (strcasecmp($reqmethod, 'HEAD') == 0);
$isget = (strcasecmp($reqmethod, 'GET') == 0);

if ((!ishead) && (!isget))
failure('403 Forbidden', "Offload server doesn't do dynamic content.");

$origurl = 'http://' . GBASESERVER . $Guri;
Expand Down Expand Up @@ -516,7 +523,6 @@ function debugInit()

// HTTP HEAD requests for PHP scripts otherwise run fully and throw away the
// results: http://www.figby.com/archives/2004/06/01/2004-06-01-php/
$ishead = (strcasecmp($_SERVER['REQUEST_METHOD'], 'HEAD') == 0);
if ($ishead)
debugEcho('This is a HEAD request to the offload server.');

Expand Down

0 comments on commit c8d9853

Please sign in to comment.