Skip to content

Commit 4f211f8

Browse files
committedFeb 25, 2024
fix(ws): resolve pathname for matching
1 parent da464c3 commit 4f211f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/app.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { joinURL, withoutTrailingSlash } from "ufo";
1+
import { hasProtocol, joinURL, parseURL, withoutTrailingSlash } from "ufo";
22
import type { AdapterOptions as WSOptions } from "crossws";
33
import {
44
lazyEventHandler,
@@ -343,7 +343,8 @@ function websocketOptions(
343343
return {
344344
...appOptions.websocket,
345345
async resolve(info) {
346-
const resolved = await evResolver(info.url);
346+
const { pathname } = parseURL(info.url || "/");
347+
const resolved = await evResolver(pathname);
347348
return resolved?.handler?.__websocket__ || {};
348349
},
349350
};

0 commit comments

Comments
 (0)
Please sign in to comment.