Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62955 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85545 invoked from network); 12 Sep 2012 09:20:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2012 09:20:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:43319] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/F6-42492-8F350505 for ; Wed, 12 Sep 2012 05:20:57 -0400 Received: by eaao11 with SMTP id o11so681751eaa.29 for ; Wed, 12 Sep 2012 02:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:x-google-sender-delegation:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=RVDT9HqT6eXqvCVL6KLNdMGWeqHMMiFSaXLCFohaWB8=; b=OBcM0/bFPx8/Ov1O7eWiprIiOb5pxRL7DwSluxO3xr+KPZBuS8OcAqXcn8IG9ubsUt 4iiudtmyGUNZHl1vjKEqxxL//0M8kGhn+33CD9I8pzznkXwbbYtqqO7OUtZRATNRjOkf FZRo++TH4kmSRjcCHshcSPJnA5yCjXe5McsrCVjfG/cRBVhvEk5MsJezSE3AHr6jauUO I1IWxqgNARSQyKrqA7QHCM0oW2WHoTXwZquVRq6oDTt6G7tTVXqK2e4xaxgmkhzfwr0u aNj+usRpNKMgkbN+yY9y1N8WS7ghGjKTa4NkV8wQP7nSHuEZfAuqiOig4jogt0XR/Ve+ QcoA== MIME-Version: 1.0 Received: by 10.14.204.200 with SMTP id h48mr30052055eeo.7.1347441654096; Wed, 12 Sep 2012 02:20:54 -0700 (PDT) Sender: sebastian.krebs.berlin@gmail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@gmail.com Received: by 10.14.176.73 with HTTP; Wed, 12 Sep 2012 02:20:54 -0700 (PDT) In-Reply-To: <50504DDD.6070001@hoa-project.net> References: <50504DDD.6070001@hoa-project.net> Date: Wed, 12 Sep 2012 11:20:54 +0200 X-Google-Sender-Auth: dqeTyb7oonL1USh-CqJBPEIJ3OU Message-ID: To: ivan.enderlin@hoa-project.net Cc: internals Content-Type: multipart/alternative; boundary=047d7b34395825e2f104c97db51c Subject: Re: [PHP-DEV] PHP build-in HTTP server and the HEAD method From: krebs.seb@gmail.com (Sebastian Krebs) --047d7b34395825e2f104c97db51c Content-Type: text/plain; charset=ISO-8859-1 Hi, As far as I can see everything works as expected: Because HEAD-requests should not send any content, you don't get any. Regards, Sebastian 2012/9/12 Ivan Enderlin @ Hoa > 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']); > > > And then: > > $ # Run the server. > $ php -S 127.0.0.1:8888 -t . foo.php > /dev/null 2>&1 & > > $ # Test with POST. > $ curl -v -X POST 127.0.0.1:8888 > * About to connect() to 127.0.0.1 port 8888 (#0) > * Trying 127.0.0.1... > * connected > * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0) > > POST / HTTP/1.1 > > User-Agent: curl/7.24.0 (...) libcurl/7.24.0 OpenSSL/0.9.8r > zlib/1.2.5 > > Host: 127.0.0.1:8888 > > Accept: */* > > > < HTTP/1.1 200 OK > < Host: 127.0.0.1:8888 > < Connection: close > < X-Powered-By: PHP/5.5.0-dev > < Content-type: text/html > < > string(4) "POST" > * Closing connection #0 > $ # It works, cool. > > $ # Now, test with HEAD. > $ curl -v -X HEAD 127.0.0.1:8888 > * About to connect() to 127.0.0.1 port 8888 (#0) > * Trying 127.0.0.1... > * connected > * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0) > > HEAD / HTTP/1.1 > > User-Agent: curl/7.24.0 (...) libcurl/7.24.0 OpenSSL/0.9.8r > zlib/1.2.5 > > Host: 127.0.0.1:8888 > > Accept: */* > > > < HTTP/1.1 200 OK > < Host: 127.0.0.1:8888 > < Connection: close > < X-Powered-By: PHP/5.5.0-dev > < Content-type: text/html > < > * Closing connection #0 > > > I have to admit that I don't understand, even by looking at the source > code. > > Thoughts? > Thanks. > > -- > Ivan Enderlin > Developer of Hoa > http://hoa.42/ or http://hoa-project.net/ > > PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) > http://disc.univ-fcomte.fr/ and http://www.inria.fr/ > > Member of HTML and WebApps Working Group of W3C > http://w3.org/ > > -- github.com/KingCrunch --047d7b34395825e2f104c97db51c--