Skip to content

[Android Only] Fixing HTTP DELETE/HEAD/OPTIONS/PATCH requests silentlty sent as GET#962

Open
jasonsandlin wants to merge 1 commit intomainfrom
user/jasonsa/lhc-and-bug-pr
Open

[Android Only] Fixing HTTP DELETE/HEAD/OPTIONS/PATCH requests silentlty sent as GET#962
jasonsandlin wants to merge 1 commit intomainfrom
user/jasonsa/lhc-and-bug-pr

Conversation

@jasonsandlin
Copy link
Copy Markdown
Member

A regression in commit 80d9d8c (PR #880 — progress report callbacks) causes HTTP requests using DELETE, HEAD, OPTIONS, or PATCH with no body to be silently sent as GET on Android. The requestBuilder.method() call was moved inside a POST/PUT-only conditional, so all other verbs never have their method set on OkHttp's Request.Builder.

Repro: Any Android HTTP call using DELETE with no request body (e.g., HCHttpCallRequestSetMethod(call, "DELETE")).

Impact: All libHttpClient Android consumers using DELETE/HEAD/OPTIONS/PATCH with no body. Requests succeed but hit the wrong server endpoint or return 405.

Fix: Commit 61f081b — move requestBuilder.method() outside the conditional so it runs for all HTTP verbs. Also add PATCH to the empty-body creation list (OkHttp requires non-null body for PATCH).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant