joffrey-bion / krossbow

A Kotlin multiplatform coroutine-based STOMP client over websockets, with built-in conversions.
MIT License
196 stars 14 forks source link

Ktor-based websocket client doesn't fail when using custom headers in the browser #460

Closed joffrey-bion closed 6 months ago

joffrey-bion commented 6 months ago

What happened?

The browser doesn't support sending custom headers in web sockets. WebSocketClient.connect() is documented to fail with IllegalArgumentException when passing custom headers to an implementation that doesn't support them, but it doesn't fail with Ktor - it simply ignores the headers.

Reproduction and additional details

No response

Krossbow version

5.12.0

Krossbow modules

krossbow-websocket-ktor

Kotlin version

1.9.22

Kotlin target platforms

JS (browser)