feat(websocket): add support for custom headers in WS check (#1180)

feat(websocket): add support for custom headers in QueryWebSocket function
This commit is contained in:
Olexandr Dovgun authored and GitHub committed 2025-08-02 14:06:46 -04:00
1 parent 8c5ad54e71
commit d27c63ded7
4 files changed
+22 -5

No files matched your search

+2 -2
View File
@@ -305,11 +305,11 @@ func TestHttpClientProvidesOAuth2BearerToken(t *testing.T) {
}
func TestQueryWebSocket(t *testing.T) {
_, _, err := QueryWebSocket("", "body", &Config{Timeout: 2 * time.Second})
_, _, err := QueryWebSocket("", "body", nil, &Config{Timeout: 2 * time.Second})
if err == nil {
t.Error("expected an error due to the address being invalid")
}
_, _, err = QueryWebSocket("ws://example.org", "body", &Config{Timeout: 2 * time.Second})
_, _, err = QueryWebSocket("ws://example.org", "body", nil, &Config{Timeout: 2 * time.Second})
if err == nil {
t.Error("expected an error due to the target not being websocket-friendly")
}