Skip to content

Commit 372af72

Browse files
Update src/milky/network/http.ts
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent 3878e94 commit 372af72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/milky/network/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class MilkyHttpHandler {
9292

9393
let inputToken = ''
9494
const authHeader = req.headers['authorization']
95-
if (authHeader) {
96-
inputToken = authHeader.split('Bearer ').pop()!
95+
if (authHeader?.toLowerCase().startsWith('bearer ')) {
96+
inputToken = authHeader.slice(7).trim()
9797
this.ctx.logger.info('receive ws header token', inputToken)
9898
} else {
9999
inputToken = url.searchParams.get('access_token') ?? ''

0 commit comments

Comments
 (0)