Skip to content

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

Merged
jasonsandlin merged 3 commits into
mainfrom
user/jasonsa/lhc-and-bug-pr
May 13, 2026
Merged

[Android Only] Fixing HTTP DELETE/HEAD/OPTIONS/PATCH requests silentlty sent as GET#962
jasonsandlin merged 3 commits into
mainfrom
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).

@jasonsandlin jasonsandlin merged commit 32d7a98 into main May 13, 2026
15 checks passed
@jasonsandlin jasonsandlin deleted the user/jasonsa/lhc-and-bug-pr branch May 13, 2026 05:05
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.

2 participants