SAPI should not add charset to each text subtype
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.2k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
The built-in webserver will add ";charset=UTF-8" to the end of the Content-Type response header of the SSE response
The following code:
<?php
header('Content-Type: text/event-stream');
for ($i = 0; $i < 3; ++$i) {
echo 'data: ' . $i . "\n\n";
}
Run server:
php -S 127.0.0.1:8080 test.php
Test:
curl http://127.0.0.1:8080/ -vvv
Resulted in this output:
# curl http://127.0.0.1:8080/ -vvv
* Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Host: 127.0.0.1:8080
< Date: Fri, 28 Apr 2023 02:51:28 GMT
< Connection: close
< X-Powered-By: PHP/8.1.18
< Content-type: text/event-stream;charset=UTF-8
<
data: 0
data: 1
data: 2
* Closing connection 0
But I expected this output instead:
# curl http://127.0.0.1:8080/ -vvv
* Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Host: 127.0.0.1:8080
< Date: Fri, 28 Apr 2023 02:51:28 GMT
< Connection: close
< X-Powered-By: PHP/8.1.18
< Content-type: text/event-stream
<
data: 0
data: 1
data: 2
* Closing connection 0
PHP Version
PHP 8.0.28, 8.1.18, 8.2.5
Operating System
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Antwort des integrierten Webservers mit dem im Issue gezeigten PHP-Skript und curl-Befehl zu reproduzieren, und verfolge dann die SAPI-Behandlung von Response-Headern für text/event-stream. Als abgeschlossen gilt die Aufgabe, wenn die Antwort Content-Type: text/event-stream ohne den automatisch angehängten charset beibehält und der vorhandene SSE-Body weiterhin zurückgegeben wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- backend, web-dev
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100