fix: postDataJSON without Content-Type header

This commit is contained in:
Max Schmitt 2024-03-13 11:36:05 +01:00
parent 349b25e61a
commit 46d2b195b0

View file

@ -141,7 +141,7 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
return null;
const contentType = this.headers()['content-type'];
if (contentType.includes('application/x-www-form-urlencoded')) {
if (contentType?.includes('application/x-www-form-urlencoded')) {
const entries: Record<string, string> = {};
const parsed = new URLSearchParams(postData);
for (const [k, v] of parsed.entries())