fix(websocket): forward URL credentials as Authorization header
Merged
RO
10mo ago+234+234+012345678901234567890123456789-4-4-0123456789
Summary
- Extracts credentials from WebSocket URL (
ws://user:pass@host) and sends them as Basic Authorization header - User-provided
Authorizationheader takes precedence over URL credentials - Credentials are properly URL-decoded before being Base64-encoded
Fixes #24388
Test plan
- Added regression test
test/regression/issue/24388.test.tswith 5 test cases:- Basic credentials in URL
- Empty password
- No credentials (no header sent)
- Custom Authorization header takes precedence
- Special characters (URL-encoded) in credentials
- Tests pass with
bun bd test test/regression/issue/24388.test.ts - Tests fail with
USE_SYSTEM_BUN=1 bun test(confirming the bug existed)
š¤ Generated with Claude Code