diff --git a/src/realtime/websocket/utils/extract-note-id-from-request-url.ts b/src/realtime/websocket/utils/extract-note-id-from-request-url.ts index 9b87f491a..e6abe99c4 100644 --- a/src/realtime/websocket/utils/extract-note-id-from-request-url.ts +++ b/src/realtime/websocket/utils/extract-note-id-from-request-url.ts @@ -20,8 +20,8 @@ export function extractNoteIdFromRequestUrl(request: IncomingMessage): string { // The example.org domain should be safe to use according to RFC 6761 ยง6.5. const url = new URL(request.url, 'https://example.org'); const noteId = url.searchParams.get('noteId'); - if (noteId === null) { - throw new Error("Path doesn't contain parameter noteId"); + if (noteId === null || noteId === '') { + throw new Error(`Path doesn't contain parameter noteId: ${request.url}`); } else { return noteId; }