full-stack-web-development
full-stack-web-development copied to clipboard
Request Query method replaced by Request Method warning. Result in 500 status code
Bug description
500
Error: request.query has been replaced by request.url.searchParams
seems like the hooks doesn't need validation because when i'm delete the if validation, it works normal
work flawlessly and has the same result to delete items :
Steps to reproduce
Create handle hooks in new kit package with validation :
if (request.query.has("_method")) {
request.method = request.query.get("_method").toUpperCase();
}
got 500 status code
Expected behavior
work normal even if with validation :
import type { Handle } from "@sveltejs/kit";
export const handle: Handle = async ({ request, resolve }) => {
if (request.query.has("_method")) {
request.method = request.query.get("_method").toUpperCase();
}
const response = await resolve(request);
return response;
};
Example repository
No response
Anything else?
No response
this has to do with this sveltekit PR? https://github.com/sveltejs/kit/pull/3384