Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121414 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6069 invoked from network); 18 Oct 2023 17:26:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Oct 2023 17:26:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7C2001804D0 for ; Wed, 18 Oct 2023 10:26:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 18 Oct 2023 10:26:09 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id E2EE53200AE3 for ; Wed, 18 Oct 2023 13:26:08 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Wed, 18 Oct 2023 13:26:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1697649968; x=1697736368; bh=3+TNxuCPwy HvpsOfY3q2GEgz/QNuHQ7fnLxgcicw9j8=; b=Y7FiqA+liiPRjZ38+53/qqlCMf a2k+NhjhxRFtD3kLBsjiFPoJ2gbygGZupoxtdtCxZK+O1PHQ01ilK5EHaCAUaoVK 6qw4VU2671T70E1T3wrE7/wrEFngh0ufuy5hnZflHeMHzjtgJeqx3rN56rH1n8W8 +ST3DZeIjAH1qbPUSkF0HP3FUvy0cIZ1WoXyTtKwpsFGemATyIrvMr4C/n4IYnQb 6Yg8Zxp+vq+zSwUtF8oY/bBnXBo4nUbP5/GzQdhCMty9Wnv85F9mZQ/4uw9dqJ3l rJnej+p80ov7fStXhBx/Gc9FDweoY4MFmC4iE6pTYsr0iXBUDRAT70nSotIA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1697649968; x= 1697736368; bh=3+TNxuCPwyHvpsOfY3q2GEgz/QNuHQ7fnLxgcicw9j8=; b=r MkBhCIQNSrkrTa52T7J7KWHl8eUMTppMevVKSDNeoACDkNrIUx3vFtvjdY8vp9T1 +1Dr+Ggbxlxjkhxsm3Uj5+xXW+X7px+weeDm3uI/7/o8d9H0XzUNDJ9KxhmFoDTm buHFCFt4rYwEtMDVbannzybcoq3ZZQRRiJ1xp4ngTNSPXtSn8YcKPz9yAC9UhKAs aGM+K3jdL/ffCR6VNS8Ibd2WkH84MetfV5SJWx3B2OhbZQwaCp3CpqJJHYCKQLmP bjXXzaZ7mTCMEnYa2XixqdTWcFLkX27UIMDRvK0F6etOmFZqK7zcTlT4PT8WjiMb RXAgagPZXuYep76pH6fSg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeggdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepgeeghefgteejheeggfeghfelueeggfdtjeeivedv tefhveeguedufeelhedvteeinecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhf ihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0AC641700089; Wed, 18 Oct 2023 13:26:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1019-ged83ad8595-fm-20231002.001-ged83ad85 MIME-Version: 1.0 Message-ID: <4daf6b2a-94dc-4d37-bb4d-512bba5f726b@app.fastmail.com> In-Reply-To: References: Date: Wed, 18 Oct 2023 17:25:46 +0000 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [RFC][Under discussion] RFC1867 for non-POST HTTP verbs From: larry@garfieldtech.com ("Larry Garfield") On Fri, Oct 13, 2023, at 11:15 AM, Ilija Tovilo wrote: > Hi everyone > > On Fri, Oct 6, 2023 at 3:44=E2=80=AFPM Ilija Tovilo wrote: >> https://wiki.php.net/rfc/rfc1867-non-post > > Thank you for the feedback so far. I made a handful of changes to the = RFC. > > * The function is renamed to request_parse_body() > * The function will now throw instead of emitting warnings when hittin= g limits > * The Configuration section was added show how parsing limits may be > modified per endpoint > * The php://input is explained better in relation to multipart parsing > > Let me know if you have any more feedback. > > Ilija The functionality all seems reasonable to me. I have a few smaller conc= erns: 1. Like Derick, I think I'd favor including the config overrides now. 2. Lots of request bodies are not forms these days; they're frequently J= SON or GraphQL. This function would be useless in those cases; that's f= ine, but should the name then suggest that it's for form data only? req= uest_parse_form() or similar? I'm just concerned about misleading peopl= e into thinking it can parse their JSON bodies, when that's not a thing.= (Unless we wanted to provide some kind of callback mechanism, which is= probably overkill here.) 3. For an unsupported mime type, I'd recommend a more specific exception= than InvalidArgumentException. Give that a custom sub-class that track= s what the actual mime type was that the request had and it rejected. 4. I don't quite grok the "input" section. So if I don't disable the au= tomatic parsing, does that mean request_parse_body() will always fail? = Or will it still work, but just be more memory-wasteful? That's not cle= ar to me; I'd prefer if it works but is just memory-wasteful, personally= , as that would be more portable for projects that want to use it. --Larry Garfield