Skip to content

fix(functions_client): use uppercase HTTP method in requests#1353

Open
j8000 wants to merge 1 commit intosupabase:mainfrom
j8000:fix/uppercase-http-method
Open

fix(functions_client): use uppercase HTTP method in requests#1353
j8000 wants to merge 1 commit intosupabase:mainfrom
j8000:fix/uppercase-http-method

Conversation

@j8000
Copy link
Copy Markdown

@j8000 j8000 commented Apr 14, 2026

Summary

  • FunctionsClient.invoke() uses HttpMethod.name to set the HTTP method on requests, which returns lowercase ("post", "get", etc.)
  • While IOClient and CupertinoClient normalize methods to uppercase internally, CronetClient (recommended Android HTTP client from cronet_http) sends the method verbatim
  • The Supabase relay rejects lowercase methods with 400 Bad Request
  • Fix: call .toUpperCase() on method.name for both http.Request and http.MultipartRequest

Fixes #1352

Test plan

  • Call supabase.functions.invoke() with CronetClient as httpClient on Android — should no longer return 400
  • Verify existing behavior unchanged with IOClient and CupertinoClient

`HttpMethod.name` returns lowercase (`"post"`, `"get"`, etc.) which
violates RFC 7230. While IOClient and CupertinoClient normalize methods
internally, CronetClient (recommended Android HTTP client) sends the
method verbatim, causing Supabase relay to reject with 400 Bad Request.

Fixes supabase#1352
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.

FunctionsClient.invoke sends lowercase HTTP method, fails with CronetClient

1 participant