Closed focused closed 2 months ago
Hi @focused!
Would you be able to test the branch I just linked?
Yes, the branch works!
I got another error:
** (Plug.Conn.WrapperError) ** (WebSockAdapter.UpgradeError) 'host' header is absent
code: conn |> MyApp.Web.Router.call(MyApp.Web.Router.init([]))
stacktrace:
(websock_adapter 0.5.6) lib/websock_adapter/upgrade_validation.ex:45: WebSockAdapter.UpgradeValidation.validate_upgrade!/1
(websock_adapter 0.5.6) lib/websock_adapter.ex:66: WebSockAdapter.upgrade/4
It seems that I missed some endpoint config, but I'm not sure. I think your MR fixes the behavior. Thank you.
Plug's test harness is by nature pretty bare-bones. You'll be on your own for ensuring the upgrade request is valid (and even then, you'll only really be able to tell that the upgrade would have succeeded; not do anything really 'end to end').
The upgrade validation code path is here if you're looking to build yourself a compliant request.
Hello!
I tried to test the upgrade route from the example and got the error:
It looks like the
WebSockAdapter
does not support thePlug.Adapters.Test.Conn
, there is no matching clause for the test adapter.I use only
:plug
package withoutphoenix
and the latest:websock_adapter
(0.5.6).Is there any workaround? Thanks for your help!