Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpClient] Psr18Client: parse HTTP Reason Phrase for Response#52329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Hanmac wants to merge6 commits intosymfony:6.4fromb3-it:httpclient_reason_phrase

Conversation

@Hanmac
Copy link
Contributor

@HanmacHanmac commentedOct 27, 2023
edited by nicolas-grekas
Loading

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#51527
LicenseMIT

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "6.4 for features / 5.4 or 6.3 for bug fixes".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

@carsonbotcarsonbot changed the titlePsr18Client: parse HTTP Reason Phrase for Response[HttpClient] Psr18Client: parse HTTP Reason Phrase for ResponseOct 27, 2023
@stof
Copy link
Member

How does this behave when the actual request is done with HTTP/2, which does not transmit a reason phrase ?

@Hanmac
Copy link
ContributorAuthor

How does this behave when the actual request is done with HTTP/2, which does not transmit a reason phrase ?

the Regex shouldn't find any, and then return nothing, and then the factory should fallback to the old one

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

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

Thanks for the PR, here are some comments.

I thinkHttplugClient might need the same, can you have a look?

Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
@Hanmac
Copy link
ContributorAuthor

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

Where can I check this right now?

I didn't saw it when making this MR

@stof
Copy link
Member

I'm not sure this checkbox exists for PRs sent from a fork owned by an organization instead of a user.

@Hanmac
Copy link
ContributorAuthor

Hanmac commentedOct 28, 2023
edited
Loading

i probably need to do some trickery withresponseFactory->createResponse and the amount of parameters.

while the Response class allows the Reason Phase to be null (and falls back to the hard codes ones, MAYBE)
the factory doesn't allow null as parameter, and passing empty string is not the same as passing 1 parameter.

so i probably need to do something like:

$responseParameters = [$response->getStatusCode()];if ($phrase =$this->getReasonPhrase($response)) {$responseParameters []=$phrase;}$psrResponse =$this->responseFactory->createResponse(...$responseParameters);

i need to try this after weekend

@derrabusderrabus removed the Bug labelOct 28, 2023
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Copy link
Member

@derrabusderrabus left a comment

Choose a reason for hiding this comment

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

This test failure appears to be related.

1)Symfony\Component\HttpClient\Tests\Psr18ClientTest::testInvalidHeaderResponseTypeError:Http\Discovery\Psr17Factory::createResponse(): Argument#2 ($reasonPhrase) must be of type string, null given, called in /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Psr18Client.php on line 109/home/runner/work/symfony/symfony/vendor/php-http/discovery/src/Psr17Factory.php:84/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Psr18Client.php:109/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php:101

@Hanmac
Copy link
ContributorAuthor

This test failure appears to be related.

1) Symfony\Component\HttpClient\Tests\Psr18ClientTest::testInvalidHeaderResponseTypeError: Http\Discovery\Psr17Factory::createResponse(): Argument #2 ($reasonPhrase) must be of type string, null given, called in /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Psr18Client.php on line 109/home/runner/work/symfony/symfony/vendor/php-http/discovery/src/Psr17Factory.php:84/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Psr18Client.php:109/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php:101

That's why I said I need to at this maybe after weekend

derrabus reacted with thumbs up emoji

@Hanmac
Copy link
ContributorAuthor

This test failure appears to be related.

1) Symfony\Component\HttpClient\Tests\Psr18ClientTest::testInvalidHeaderResponseTypeError: Http\Discovery\Psr17Factory::createResponse(): Argument #2 ($reasonPhrase) must be of type string, null given, called in /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Psr18Client.php on line 109/home/runner/work/symfony/symfony/vendor/php-http/discovery/src/Psr17Factory.php:84/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Psr18Client.php:109/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php:101

took my laptop to work on this thing ... see my idea above with the variable parameters

@HanmacHanmac requested a review fromderrabusOctober 29, 2023 08:40
@Hanmac
Copy link
ContributorAuthor

The last failures seems to be unrelated?

@nicolas-grekasnicolas-grekas changed the base branch from6.4 to5.4October 29, 2023 12:34
@nicolas-grekasnicolas-grekas changed the base branch from5.4 to6.4October 29, 2023 12:36
@nicolas-grekas
Copy link
Member

Thank you@Hanmac.

nicolas-grekas added a commit that referenced this pull requestOct 29, 2023
…ponse (Hanmac)This PR was submitted for the 6.4 branch but it was squashed and merged into the 5.4 branch instead.Discussion----------[HttpClient] Psr18Client: parse HTTP Reason Phrase for Response| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#51527| License       | MITCommits-------115a5a1 [HttpClient] Psr18Client: parse HTTP Reason Phrase for Response
@nicolas-grekas
Copy link
Member

Merged as115a5a1 in 5.4
For your next PR, please allow edits from maintainers.

@GrahamCampbell
Copy link
Contributor

GrahamCampbell commentedOct 29, 2023
edited
Loading

For your next PR, please allow edits from maintainers.

Edits were not possible because it was forked to an organization account.

OskarStark reacted with thumbs up emoji

@HanmacHanmac deleted the httpclient_reason_phrase branchOctober 29, 2023 20:38
@fabpotfabpot mentioned this pull requestNov 10, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@derrabusderrabusAwaiting requested review from derrabus

@lyrixxlyrixxAwaiting requested review from lyrixx

@ycerutoycerutoAwaiting requested review from yceruto

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

[HttpClient]Psr18Client can't get custom HTTP status messages

6 participants

@Hanmac@carsonbot@stof@nicolas-grekas@GrahamCampbell@derrabus

[8]ページ先頭

©2009-2025 Movatter.jp