Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110238 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7653 invoked from network); 21 May 2020 23:28:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 May 2020 23:28:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EFAE61804F6 for ; Thu, 21 May 2020 15:07:09 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 21 May 2020 15:07:09 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C41045C0095 for ; Thu, 21 May 2020 18:07:08 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Thu, 21 May 2020 18:07:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=apiWnc6hg48cjIIWupZ0BLPo3dmBcrXl8ZEoqFxe5 do=; b=DZhMK/F7qA+k3ToYwJO1EBPnO7qjstUeaJGfoEYCOlT4jlCpJGaHHqmIH OltcS9CRNl5+9A2yM0gkbP7MSuxrIlAUfCrQz6i9EELSJWh7f05ZHXvvteKO9tXV PfWShWGvAQliY1eaZMyPKkcLkskg1h1ddhuhoA+q0HJ78oiDh16vPwN4dGrPPGbB dFhwAdUgETIDrSTCScORtdlQwFJxkHb8IxcHH6oOfZrDEXDXck8sPVdee1wI678T 9CaJl676Sfv1+1tLDmOqVSF4wcj0Et/N13jRSNbeKwPG85zzeMzIfCXt+gl/nQSo hudUqeSGb9c/D0jhZW/J0IU923JGg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudduvddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhephfejtedulefhfeefteejgfeivdelffetudeijeeg iedugeelgfeivdffvedujefhnecuffhomhgrihhnpegvgihtvghrnhgrlhhsrdhiohdpgh hithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7941314200A2; Thu, 21 May 2020 18:07:08 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-487-g38013f6-fm-20200519.001-g38013f6c Mime-Version: 1.0 Message-ID: <5c6d1ecd-aa27-4cbf-afb1-234e15e1b0bf@www.fastmail.com> In-Reply-To: References: Date: Thu, 21 May 2020 17:06:47 -0500 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] HTTP/1.1 by default in PHP 8.0 From: larry@garfieldtech.com ("Larry Garfield") On Thu, May 21, 2020, at 4:53 PM, Rowan Tommins wrote: > Hi all, >=20 > A few years ago, I posted a message suggesting that PHP improve suppor= t=20 > for HTTP/1.1 in its stream wrapper functions:=20 > https://externals.io/message/96192 >=20 > A quick summary of the current situation: >=20 > * HTTP/1.1 was officially standardised in January 1997, and most web=20= > browsers had already implemented it by then > * PHP has a very simple HTTP client implementation, used by the "http:= "=20 > and "https:" stream wrappers, and also by extensions which make HTTP=20= > requests, such as ext/soap > * The client implementation defaults to advertising HTTP/1.0 requests,= =20 > unless over-ridden by a stream context option > * Since a lot of servers only actually talk HTTP/1.1, the client mostl= y=20 > acts as an HTTP/1.1 client even when advertising HTTP/1.0 >=20 >=20 > In my previous message, I identified four requirements in HTTP/1.1 but= =20 > not HTTP/1.0 that are relevant to a client: >=20 > a) Send a "Host" header with every request. (RFC 7230 Section 5.4) > b) Support persistent connections, or send "Connection: Close" with ea= ch=20 > request. (RFC 7230 Section 6.1) > c) Ignore 1xx status lines (notably, "100 Continue") "even if the clie= nt=20 > does not expect one" (RFC 7231 Section 6.2) > d) Support "chunked" transfer encoding (RFC 7230 Section 4.1) >=20 >=20 > The PHP client now supports all four regardless of protocol version=20= > configured, i.e. it always sends "Host:" and "Connection: Close"=20 > headers; and always handles "100 Continue" and "Transfer-Encoding:=20 > Chunked" if returned by the server. >=20 > I would like to propose that the client advertises HTTP/1.1 in its=20 > requests by default in PHP 8.0.=C2=A0 Users can opt out of this behavi= our in=20 > a fully backwards- and forwards-compatible way if necessary using a=20= > stream context option, e.g.:=20 > https://gist.github.com/IMSoP/a685fed6589435530102d57138755511 >=20 >=20 > What are people's opinions? Does this need an RFC, or should I just=20= > submit a PR if nobody objects? >=20 >=20 > Regards, >=20 > --=20 > Rowan Tommins (n=C3=A9 Collins) > [IMSoP] This makes complete sense to me. Whether it needs a formal RFC or not i= s above my pay grade, but I expect it would be just a formality if so. = +1 --Larry Garfield