Skip to content

Fix GH-16137: "Deduplicate" *Forwarded* http headers values. - #16154

Closed
devnexen wants to merge 1 commit into
php:PHP-8.2from
devnexen:gh16137
Closed

devnexen wants to merge 1 commit into
php:PHP-8.2from
devnexen:gh16137

Conversation

@devnexen

@devnexen devnexen commented Oct 1, 2024

Copy link
Copy Markdown
Member

Those are meant to have 1 or plus values separated by a comma even
if the client set them separately.

Comment thread sapi/cli/php_cli_server.c Resolved
@devnexen devnexen linked an issue Oct 1, 2024 that may be closed by this pull request
@devnexen
devnexen marked this pull request as ready for review October 2, 2024 05:04
Comment thread sapi/cli/php_cli_server.c Resolved
Comment thread sapi/cli/php_cli_server.c Resolved
Comment thread sapi/cli/php_cli_server.c Resolved
Comment thread sapi/cli/php_cli_server.c Resolved
Comment thread sapi/cli/php_cli_server.c Resolved
Comment thread sapi/cli/php_cli_server.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can use ZVAL_NEW_STR here, but not terribly important.

Comment thread sapi/cli/php_cli_server.c Resolved

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is right as far as I understand. But maybe wait for like at least one more approval.

@devnexen
devnexen requested a review from cmb69 October 3, 2024 19:10

@cmb69 cmb69 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Besides the nits, this looks good to me.

Comment thread sapi/cli/php_cli_server.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you revert the conditions, you can simplify:

Suggested change
if ((entry == NULL && with_comma) || !with_comma) {
if (!with_comma || entry == NULL) {

This is the same as with_comma → entry == NULL (logical implication).

Comment thread sapi/cli/php_cli_server.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Superfluous empty line:

Suggested change

Those are meant to have 1 or plus values separated by a comma even
 if the client set them separately.
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.

Built-in webserver not passing header correctly

4 participants