Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(qwik-city): parseBody should not clone Request #5353

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -314,17 +314,16 @@ const parseRequest = async (
sharedMap: Map<string, any>,
qwikSerializer: QwikSerializer
): Promise<JSONValue | undefined> => {
const req = request.clone();
const type = request.headers.get('content-type')?.split(/[;,]/, 1)[0].trim() ?? '';
if (type === 'application/x-www-form-urlencoded' || type === 'multipart/form-data') {
const formData = await req.formData();
const formData = await request.formData();
sharedMap.set(RequestEvSharedActionFormData, formData);
return formToObj(formData);
} else if (type === 'application/json') {
const data = await req.json();
const data = await request.json();
return data;
} else if (type === 'application/qwik-json') {
return qwikSerializer._deserializeData(await req.text());
return qwikSerializer._deserializeData(await request.text());
}
return undefined;
};
Expand Down