Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94626 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75834 invoked from network); 22 Jul 2016 10:28:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2016 10:28:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.174 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.174 mail-yw0-f174.google.com Received: from [209.85.161.174] ([209.85.161.174:35765] helo=mail-yw0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/01-52781-735F1975 for ; Fri, 22 Jul 2016 06:28:07 -0400 Received: by mail-yw0-f174.google.com with SMTP id j12so92326724ywb.2 for ; Fri, 22 Jul 2016 03:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=U6FBWYWgxTt2NNQzsXCPSqzLCuiv3imdiROg4Rnc240=; b=0lSvUHvnqKaZZT+avR/TeJ6Kc9wRN00TpWBKs1OpoGMWtWtTzgluNehnm5vN0Xqy1u 7Ccpia7wySH38yzu76jpiamgb/0kIvvV8GVS6Nv3Iq3kGlsdmJRT5Zesx3jG47steo4w ZXmx3HuJFqBG+sikfCGqfvNifBpg9W9aKSAYm4jIDObiO5CGm/q4HPa98lyCs54+lrEk b0wPvA6+qzW73aqSGeKMrAEqP/t2L3ixPHuanrT/bR49Z8efGnfO/9hXrErRvJ917A1x UsbmwA4WUbbxMFjYenDhrC+xB3rZZYa2iQqcvEHMd0bja83krepIKBYd/i+v4iK9Rg15 ZCzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=U6FBWYWgxTt2NNQzsXCPSqzLCuiv3imdiROg4Rnc240=; b=AcfzgByN/T3KpSTLgZJ99t63u+Gm+amYR2m01x5QDja/ne7Ljjm5ZOhtgbHxQCdIjM V19HQ9BGl4Msk4Lfrg0qG/1mVR5ZK0dgTFhfcPCPBBSO0aYZ1I8BJgV3QRITvW9fVksN lJb3m6PmlGmIpw3tyq+T07KRIZrUioF0l6vU3PWLZCYzjbS45AA6ColGIODDOH32+scc 1mqsE67Y9LVHdqEFJn4qjnOswrFzoUtMtinflZ2d1iJ12y2I95jHlg13C6xAsNeMUpU/ ONkS6Fl4beKsYCSg8fT5lGiMjFHHN0hD4m1VEqvhXrt5tfZcbluP6hnmbJ911rTQpl9N fnww== X-Gm-Message-State: AEkoousBHbLziwNSJMr9gh4rXz5/e6GzZSZuBzLzL3b7PtVFglk8kpwoHhro9GGHaTqTHrNmLG/jzkbO5ocBfg== X-Received: by 10.37.202.74 with SMTP id a71mr2214779ybg.61.1469183284475; Fri, 22 Jul 2016 03:28:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.131.129 with HTTP; Fri, 22 Jul 2016 03:28:03 -0700 (PDT) In-Reply-To: <9d7bf704-44f9-1888-0761-8a91adfa8391@mokrynskyi.com> References: <9d7bf704-44f9-1888-0761-8a91adfa8391@mokrynskyi.com> Date: Fri, 22 Jul 2016 12:28:03 +0200 Message-ID: To: Nazar Mokrynskyi Cc: PHP internals , Christoph Michael Becker Content-Type: multipart/alternative; boundary=94eb2c05b3aac8179a053836e3c1 Subject: Re: [PHP-DEV] Add support for arbitrary HTTP methods From: nikita.ppv@gmail.com (Nikita Popov) --94eb2c05b3aac8179a053836e3c1 Content-Type: text/plain; charset=UTF-8 On Fri, Jul 22, 2016 at 2:28 AM, Nazar Mokrynskyi wrote: > Hi internals, > > I want to bring here question about supporting custom http methods in > built-in webserver with router script. > > The problem is that GET, POST are standard methods and they work fine, > but for custom methods like XYZ_METHOD_ALSO_ALLOWED webserver responds > with 501 Not Implemented. > > 501 ideally should never happen when router script is used, since it is > up to router to decide whether it can handle the request or not. > > Initial bug report for additional info and references: > https://bugs.php.net/bug.php?id=72619 > Sample repository to reproduce an issue: > https://github.com/nazar-pc/php-bug-72619 > > Christoph Michael Becker said on bug tracker that this kind of change > will probably require an RFC, however for me this appears to be pretty > minor change that can barely be a breaking change to someone and it > should even be backported to 7.0/5.6 when/if implemented in 7.1. > > I do not code in C/C++, but I can prepare some PHPT tests for this > feature if someone is willing to help here. > Agree, I don't see why this would need an RFC. I don't see a point in the HTTP request method detection -- in the end, applications will only be able to handle a small fraction of the request methods we consider "allowed". so it's not like these checks are in any way meaningful -- the application layer still has to deal with this itself if it's actually interested in generating accurate 405 responses. It's a PITA to keep this list updated (we're pretty bad at this -- we're very out of sync with the upstream implementation) and prevents use of custom methods. Nikita --94eb2c05b3aac8179a053836e3c1--