Skip to content

[HttpClient] fix dealing with 1xx informational responses #32141

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 23, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

I never had a look at 1xx status codes until today.
This PR fixes reading them when using curl.

If one wonders:

  • NativeHttpClient uses fopen(), which skips informational parts as allowed by the HTTP spec and doesn't give any way to access their response headers.
  • CurlHttpClient allows reading informational responses using the progress callback or via the getInfo() method. That's the way if you need to implement e.g. HTTP 103 early hints.

@fabpot
Copy link
Member

fabpot commented Jun 26, 2019

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 412411d into symfony:4.3 Jun 26, 2019
fabpot added a commit that referenced this pull request Jun 26, 2019
…(nicolas-grekas)

This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix dealing with 1xx informational responses

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I never had a look at 1xx status codes until today.
This PR fixes reading them when using curl.

If one wonders:
- `NativeHttpClient` uses `fopen()`, which skips informational parts as allowed by the HTTP spec and doesn't give any way to access their response headers.
- `CurlHttpClient` allows reading informational responses using the progress callback or via the getInfo() method. That's the way if you need to implement e.g. HTTP 103 early hints.

Commits
-------

412411d [HttpClient] fix dealing with 1xx informational responses
@fabpot fabpot mentioned this pull request Jun 26, 2019
@nicolas-grekas nicolas-grekas deleted the hc-103 branch July 4, 2019 14:15
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.

3 participants