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

CronetClient didn't setup proper method for requests #1053

Closed
AlexV525 opened this issue Nov 24, 2023 · 0 comments · Fixed by #1058
Closed

CronetClient didn't setup proper method for requests #1053

AlexV525 opened this issue Nov 24, 2023 · 0 comments · Fixed by #1058
Assignees
Labels
package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@AlexV525
Copy link
Contributor

(downstream cfug/dio#2035)

When making requests with the DELETE method, POST was sent instead. This is caused by the missing request method setup before we start the builder.

final builder = engine.newUrlRequestBuilder(
request.url.toString().toJString(),
jb.UrlRequestCallbackProxy.new1(
_urlRequestCallbacks(request, responseCompleter)),
_executor,
);

Instead, we can write:

  final builder = engine.newUrlRequestBuilder(
    request.url.toString().toJString(),
    jb.UrlRequestCallbackProxy.new1(
        _urlRequestCallbacks(request, responseCompleter)),
    _executor,
- );
+ ).setHttpMethod(request.method.toJString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
2 participants