Skip to content

Conversation

@Yurunsoft
Copy link
Contributor

fix #11146

@Yurunsoft Yurunsoft requested a review from bukka as a code owner April 28, 2023 08:32
@Yurunsoft Yurunsoft closed this Apr 28, 2023
@Yurunsoft Yurunsoft deleted the fix-event-stream branch April 28, 2023 09:08
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented on the issue, the change makes sense but needs to be more generic.


if (*mimetype != NULL) {
if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) {
if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL && strcmp(*mimetype, "text/event-stream") != 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be more generic so we can use it for other subtypes that could be added as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also start comparisons from subtype as text/ is already checked...

$host = PHP_CLI_SERVER_HOSTNAME;

$fp = php_cli_server_connect();
if(fwrite($fp, <<<HEADER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice if you could define heredoc outside if to be more readable. Also there should be a space after if

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SAPI should not add charset to each text subtype

2 participants