Skip to content

Commit

Permalink
fix(ws): resolve pathname for matching
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 25, 2024
1 parent da464c3 commit 4f211f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { joinURL, withoutTrailingSlash } from "ufo";
import { hasProtocol, joinURL, parseURL, withoutTrailingSlash } from "ufo";
import type { AdapterOptions as WSOptions } from "crossws";
import {
lazyEventHandler,
Expand Down Expand Up @@ -343,7 +343,8 @@ function websocketOptions(
return {
...appOptions.websocket,
async resolve(info) {
const resolved = await evResolver(info.url);
const { pathname } = parseURL(info.url || "/");
const resolved = await evResolver(pathname);
return resolved?.handler?.__websocket__ || {};
},
};
Expand Down

0 comments on commit 4f211f8

Please sign in to comment.