Skip to content

Commit fae488f

Browse files
chore(internal/client): fix form-urlencoded requests
1 parent 25002d6 commit fae488f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/client.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,14 @@ export class Grid {
746746
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
747747
) {
748748
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
749+
} else if (
750+
typeof body === 'object' &&
751+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
752+
) {
753+
return {
754+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
755+
body: this.stringifyQuery(body as Record<string, unknown>),
756+
};
749757
} else {
750758
return this.#encoder({ body, headers });
751759
}

0 commit comments

Comments
 (0)