sometimes there is no port

This commit is contained in:
Chris Wanstrath 2025-10-08 12:48:03 -07:00
parent cba61cb061
commit 1dfc89361b

View File

@ -167,7 +167,7 @@ app.get("/", c => c.html(<Layout><Terminal /></Layout>))
app.get("/ws", c => { app.get("/ws", c => {
const _sessionId = c.req.query("session") const _sessionId = c.req.query("session")
const url = new URL(c.req.url) const url = new URL(c.req.url)
let hostname = url.hostname + (url.port === "80" ? "" : `:${url.port}`) let hostname = url.hostname + (!url.port || url.port === "80" ? "" : `:${url.port}`)
return upgradeWebSocket(c, { return upgradeWebSocket(c, {
async onOpen(_e, ws) { async onOpen(_e, ws) {