Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62953 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82645 invoked from network); 12 Sep 2012 09:15:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2012 09:15:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=damz@damz.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=damz@damz.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain damz.org designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: damz@damz.org X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:48553] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/46-42492-DB250505 for ; Wed, 12 Sep 2012 05:15:42 -0400 Received: by lahl5 with SMTP id l5so978979lah.29 for ; Wed, 12 Sep 2012 02:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=damz.org; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gt/II7U6W/3ph/vm+PFF2plauGt7AJLK2GrC64oT75Y=; b=Lb5AFVgzK/zKB8U/uCU/LKcq7MpH7qAICy42kK/zTNfOjTE/YgTNKTdiFU4aHxZxlo JrMZIKLGoVkpWFeNL1NsyUJy75W2aPsh9F8h8yGBSu/Xn0clBHaPxeQCat7xIqEPzq+j UzpUfcyGGMtZRAtvRr9g818XBJ2cNtzt2FWTs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=gt/II7U6W/3ph/vm+PFF2plauGt7AJLK2GrC64oT75Y=; b=TSPGTTx16MjR6HKAlAnMV+GpyQXvgCkCyUYMUo/BBHu6thfxovEFiu16NlApTIQH7Y vt2ZgGLffn1jUsmxohr6JLLndxtQE82uXzh0sCBGfJrTlaj0UuCK4LvoTLv8VTRKK2zP yEp98i7qRWeqEHKdqnGbsT8DIn7Xvu7d2bSOpAhqe5j0coQ2vygWInXLvcozJe8PEka0 JMlqRC10P5fadBnBAM1IFTTQKyrnXCuoHM0favoccvi20QrY2R7cdIH99UKo9LHxzlpI RYbOXGi7imSq/4BLcKuVI7dFUscn533xIJYJYXdmZWcOpZorXX3T9RkP9cjJt+hxpuLk k+eA== MIME-Version: 1.0 Received: by 10.112.38.69 with SMTP id e5mr6886765lbk.14.1347441338590; Wed, 12 Sep 2012 02:15:38 -0700 (PDT) Received: by 10.112.24.100 with HTTP; Wed, 12 Sep 2012 02:15:38 -0700 (PDT) X-Originating-IP: [90.24.145.200] In-Reply-To: <50504DDD.6070001@hoa-project.net> References: <50504DDD.6070001@hoa-project.net> Date: Wed, 12 Sep 2012 11:15:38 +0200 Message-ID: To: ivan.enderlin@hoa-project.net Cc: internals Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnRtOJPdzT8ijyJKTmjGryHfz1HLRkreWOKE+ttS8qmME3SYnw7NJkkwM3INBXDPzP4Msxl Subject: Re: [PHP-DEV] PHP build-in HTTP server and the HEAD method From: damz@damz.org (Damien Tournoud) On Wed, Sep 12, 2012 at 10:54 AM, Ivan Enderlin @ Hoa wrote: > Hello, > > It is probably me but it seems like the build-in HTTP server does not well > support the HEAD method. Here is my following test case. First, the foo.php > file: > > > var_dump($_SERVER['REQUEST_METHOD']); By definition, a HEAD request MUST NOT return a message-body. This works as expected: Here is how it works: main/SAPI.c has code that set SG(request_info).headers_only = 1 for HEAD requests, and as a consequence php_request_shutdown() does not flush the output buffer (if any) to the client. You can force a body to be sent (but that's likely not going to work with every SAPI) by not having an output buffer or by calling ob_end_flush() yourself. Damien