Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa authored Oct 1, 2021
1 parent aab15d7 commit 8b9a96b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/adapter-node/src/kit-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import { getRawBody } from '@sveltejs/kit/node';
// @ts-ignore
export function create_kit_middleware({ render }) {
return async (req, res) => {
const parsed = new URL(req.url || '', 'http://localhost');
let parsed;
try {
parsed = new URL(req.url || "", "http://localhost");
} catch(e) {
res.statusCode = 400;
return res.end("Invalid URL");
}

let body;

Expand Down

0 comments on commit 8b9a96b

Please sign in to comment.