[doc-en] master: fix(reference/stream): HTTP headers are U+0D U+0A (CR LF) separated
| From: | hakre via Niels Dossche | Date: | Sun, 22 Jun 2025 14:57:33 +0000 |
| Subject: | [doc-en] master: fix(reference/stream): HTTP headers are U+0D U+0A (CR LF) separated | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-22698@lists.php.net to get a copy of this message | ||
Author: hakre (hakre)
Committer: Niels Dossche (nielsdos)
Date: 2025-06-22T16:45:06+02:00
Commit: https://github.com/php/doc-en/commit/c49274b06187db6cf96df8a48e5a3b92d1b56b16
Raw diff: https://github.com/php/doc-en/commit/c49274b06187db6cf96df8a48e5a3b92d1b56b16.diff
fix(reference/stream): HTTP headers are U+0D U+0A (CR LF) separated
correction of the formally wrong comment and place in the example code.
streamlining the example code style on separating multiple headers over multiple lines.
compare Section 4.1 of RFC-2616 etc.
generic-message = start-line
*(message-header CRLF)
CRLF
[ message-body ]
RFC-2616: https://www.rfc-editor.org/rfc/rfc2616#section-4.1
ok: /reference/stream/functions/stream-context-set-default.xml etc.
Changed paths:
M reference/stream/functions/stream-context-create.xml
Diff:
diff --git a/reference/stream/functions/stream-context-create.xml
b/reference/stream/functions/stream-context-create.xml
index 09eff1e645d0..83d15668cb85 100644
--- a/reference/stream/functions/stream-context-create.xml
+++ b/reference/stream/functions/stream-context-create.xml
@@ -88,8 +88,9 @@
$opts = [
'http' => [
'method' => "GET",
- // Use newline \n to separate multiple headers
- 'header' => "Accept-language: en\nCookie: foo=bar",
+ // Use CRLF \r\n to separate multiple headers
+ 'header' => "Accept-language: en\r\n" .
+ "Cookie: foo=bar",
]
];