[PR #6111] [MERGED] chore: bump better-fetch #23354

Closed
opened 2026-04-15 21:39:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6111
Author: @dvanmali
Created: 11/19/2025
Status: Merged
Merged: 12/10/2025
Merged by: @Bekacru

Base: canaryHead: proxyBody


📝 Commits (1)

  • cba5010 fix: send client body as form-urlencoded when specified as header

📊 Changes

2 files changed (+15 additions, -17 deletions)

View changed files

📝 pnpm-lock.yaml (+14 -16)
📝 pnpm-workspace.yaml (+1 -1)

📄 Description

Properly encodes JSON body as a application/x-www-form-urlencoded when sent from a client. For example, when allowedMediaTypes: ["application/x-www-form-urlencoded"] (meaning json is not accepted), this requires the client to send the application/x-www-form-urlencoded header.

Example use case:

const tokens = await client.oauth2.token({
	grant_type: "client_credentials",
	client_id
	client_secret,
	scope,
	redirect_uri,
}, {
	headers: {
		accept: "application/json",
		'content-type': "application/x-www-form-urlencoded"
	},
});

Summary by cubic

Send client request bodies as application/x-www-form-urlencoded when the content-type header is set. This fixes requests to endpoints that require form-encoded payloads (e.g., OAuth2 token).

  • Bug Fixes
    • Serialize the body with URLSearchParams when content-type is application/x-www-form-urlencoded; otherwise send the original body.

Written for commit cba5010d09. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6111 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 12/10/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `proxyBody` --- ### 📝 Commits (1) - [`cba5010`](https://github.com/better-auth/better-auth/commit/cba5010d09ce675574fb9306b66ac594215dcbc4) fix: send client body as form-urlencoded when specified as header ### 📊 Changes **2 files changed** (+15 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `pnpm-lock.yaml` (+14 -16) 📝 `pnpm-workspace.yaml` (+1 -1) </details> ### 📄 Description Properly encodes JSON body as a `application/x-www-form-urlencoded` when sent from a client. For example, when `allowedMediaTypes: ["application/x-www-form-urlencoded"]` (meaning json is not accepted), this requires the client to send the `application/x-www-form-urlencoded` header. Example use case: ```ts const tokens = await client.oauth2.token({ grant_type: "client_credentials", client_id client_secret, scope, redirect_uri, }, { headers: { accept: "application/json", 'content-type': "application/x-www-form-urlencoded" }, }); ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Send client request bodies as application/x-www-form-urlencoded when the content-type header is set. This fixes requests to endpoints that require form-encoded payloads (e.g., OAuth2 token). - **Bug Fixes** - Serialize the body with URLSearchParams when content-type is application/x-www-form-urlencoded; otherwise send the original body. <sup>Written for commit cba5010d09ce675574fb9306b66ac594215dcbc4. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 21:39:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#23354