Open pini-gh opened 3 years ago
That should not be needed. https://github.com/tmate-io/tmate-websocket/blob/master/lib/tmate/master_api.ex#L7 enables the json transforms https://github.com/tmate-io/tmate-websocket/blob/master/lib/tmate/util/json_api.ex#L37 decoding should happen here.
If your PR is fixing a bug, how can I reproduce it?
If your PR is fixing a bug, how can I reproduce it?
This is explained in #7. See the console part.
Seems fine here
Thanks to your pointers I've found out where the actual problem lies: https://github.com/tmate-io/tmate-websocket/blob/master/lib/tmate/util/json_api.ex#L35
For the tmate-websocket instance I used the same value for MASTER_BASE_URL
and USER_FACING_BASE_URL
. Then the /named_session_prefix
request was going through my reverse-proxy, which uses Content-Type
instead of content-type
as header name.
It works if I set MASTER_BASE_URL
to the internal URL http://tmate-master:4000/
. In this case the header name is content-type
(all lowercase). But it might be worth making the header name lookup case insensitive:
content_type_hdr = Enum.find(headers, fn {name, _} -> String.downcase(name) == "content-type" end)
Fixes #7.