Skip to content

Commit 8193077

Browse files
chore(internal/client): fix form-urlencoded requests
1 parent be80828 commit 8193077

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/client.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,14 @@ export class OzAPI {
694694
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
695695
) {
696696
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
697+
} else if (
698+
typeof body === 'object' &&
699+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
700+
) {
701+
return {
702+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
703+
body: this.stringifyQuery(body as Record<string, unknown>),
704+
};
697705
} else {
698706
return this.#encoder({ body, headers });
699707
}

0 commit comments

Comments
 (0)