Skip to content

Preserve custom Host headers for WebSocket requests - #6172

Merged
stamparm merged 1 commit into
sqlmapproject:masterfrom
bingdongni:fix/websocket-custom-host
Nov 4, 2026
Merged

stamparm merged 1 commit into
sqlmapproject:masterfrom
bingdongni:fix/websocket-custom-host

Conversation

@bingdongni

Copy link
Copy Markdown
Contributor

For WebSocket targets, --host and Host headers supplied through --headers are discarded before the handshake. A scan against a virtual host therefore uses the URL's host instead.

Pass explicit Host overrides to the WebSocket client while retaining its existing default Host generation. The regression test covers configured headers, per-request overrides, header files, auxiliary headers, and the default case.

Tests:

  • Python 3.12: 2,745 tests run, 15 skipped.
  • PyPy 2.7 on Windows: 2,737 tests run, 34 skipped, excluding test_replication. Its six SQLite teardown errors also reproduce on unmodified master.
  • Verified the handshake against a loopback WebSocket server; Pyflakes and git diff --check passed.

@stamparm
stamparm merged commit 74f5012 into sqlmapproject:master Nov 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants