Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114585 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36447 invoked from network); 25 May 2021 12:58:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 May 2021 12:58:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2F34C1804B5 for ; Tue, 25 May 2021 06:09:31 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 25 May 2021 06:09:30 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id f12so38055132ljp.2 for ; Tue, 25 May 2021 06:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=SK35ThTfgx6XZcn/n1Cz1hYrug/2jTVC/oejyWoPQrM=; b=cMab5XoJnbUAEkKMlghCrlSZYh8nHViojUEMTP0OLIie0qXa5RDUmhstllnaUmX9fo 6DHqZ8FzFsWvY5Dq0zzyQKQkIx5nwIOkccJmpze/zRRdxazw7MFlWdIJl+CqcN4xYLMc TL5CPqkTBxD8pCqpXTe4z5U77dQo07mLO9dFI/zF1aH2oSyWvizLM7HJZ60WQeLe8UHj YSE2gimkJiCvyAcPm9vkSN6tQ6Ems9lSMtviyG6gHqxsQAgy5vxQOJCOcwyJbfMNTdYl KcPPEo8wq4ZT5mrQePZCjlLWdCETGWqYych4CBv3hgYG11DcQG0paeUarWYPQzOID8Bp S3ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SK35ThTfgx6XZcn/n1Cz1hYrug/2jTVC/oejyWoPQrM=; b=k0/jSRFwRznLQALM/Il5vDSMr8wUQh/Nvd/r7byp+NaqSX0ZqpvgyZWuaLA+BN9CkI yYyMu8sgD0txHsm6ZfoVTuDQlhqo54HV5mAowdYPo5Pssd1zrrtVwVUxT86OWEd6OI79 gumgeTN0dp1cjKkkoOtzO2elBLQoaTauS1/2FCMqqZ502plM3yrhwaY0pXaxBqqSe2qU 2IJkxQ/vj+tx4m+7H1vP/FjFtGOER5txmGIJ05pA86O4G9aKlpTHiLQZCd0qnJiPyDXZ F8Tf9G4XxBXJE1g/XcUKdAXe9bh6cjrQ7FYXp8jzBXmn3Pc05bmaCWMw8deRnlX+Z02W OWgA== X-Gm-Message-State: AOAM531NPHFVtHQoC0gvZKJ8wWG4qFJDEyamaXovfSwdfdeCert8wtRJ KKSGhX83MTolIhAGnlVmF1JLiZqDo6OBucB+XvNidtyLkLuJlw== X-Google-Smtp-Source: ABdhPJzxn8To22ZMMg4awAfzah+cPQb6BDsi8mosq0YJHnByVJhjsxQUyKp6MvBXnKfQ14HRa46/iGtOngD1V7uim2o= X-Received: by 2002:a05:651c:50f:: with SMTP id o15mr20555936ljp.452.1621948168814; Tue, 25 May 2021 06:09:28 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 25 May 2021 15:09:13 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000072469a05c3273c16" Subject: HTTP Early Hint support From: nikita.ppv@gmail.com (Nikita Popov) --00000000000072469a05c3273c16 Content-Type: text/plain; charset="UTF-8" Hi internals, Currently, PHP only supports sending one set of headers. HTTP 1xx status codes may require sending multiple sets of headers. In particular, to use 103 Early Hints you need to first send Link headers for early hints, and then, once your actual response is ready, send the usual 200/whatever response headers and response body. It's possible to do this currently, but rather awkward: You send the first set of headers (the early hints) using header(), and then you output the second set of headers manually (direct echo). This also isn't compatible with any internal functions (e.g. the session module) that add headers automatically. https://github.com/php/php-src/pull/7025 adds a function for sending a set of headers early and resetting the current header/response code state, so you can send normal response headers afterwards. Any thoughts on supporting this feature? There's already some ongoing bikeshedding regarding the function name on the PR... Regards, Nikita --00000000000072469a05c3273c16--