Skip to content

Commit 6f2394d

Browse files
chore(internal/client): fix form-urlencoded requests
1 parent 602ae0a commit 6f2394d

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
@@ -845,6 +845,14 @@ export class Dedalus {
845845
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
846846
) {
847847
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
848+
} else if (
849+
typeof body === 'object' &&
850+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
851+
) {
852+
return {
853+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
854+
body: this.stringifyQuery(body as Record<string, unknown>),
855+
};
848856
} else {
849857
return this.#encoder({ body, headers });
850858
}

0 commit comments

Comments
 (0)