Skip to content
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

Fix a bug where cronet_http sends incorrect HTTP request methods #1058

Merged
merged 3 commits into from
Nov 29, 2023

Conversation

brianquinlan
Copy link
Collaborator

@brianquinlan brianquinlan commented Nov 29, 2023


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.


test('custom method', () async {
await client.send(Request(
'CUSTOM',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we test case-sensitive method too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem is that IOClient would not pass that test because it always uppercases the request method:
https://github.com/dart-lang/sdk/blob/0b10bfcde99def6c43d4a306c920ba1ba855d058/sdk/lib/_http/http_impl.dart#L2791

This seems like a bug according to RFC-7232: https://www.rfc-editor.org/rfc/rfc7231#section-4.1

I will add a case-insensitive test and then a flag to disable it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh well, another bug, good spot. 👍

@brianquinlan brianquinlan requested review from devoncarew and removed request for natebosch November 29, 2023 18:45
@brianquinlan brianquinlan merged commit 40a46d8 into dart-lang:master Nov 29, 2023
@AlexV525
Copy link
Contributor

@brianquinlan Could you also publish a new version of cronet_http_embedded? It's been outdated for a while. (Also see #1047)

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.

CronetClient didn't setup proper method for requests
3 participants