@choptastic I'll come back and add more of a description later. I wrote a large summary twice before I realized my commits were failing because my GPG had expired.
Basically this merges in the host value that Cowboy knows when the HTTP header is missing, as it apparently is when running in cowboy:start_tls/3 mode. I suspect this is related to TLS/SNI.
As I think about this I think a better approach might be to add a new host(req()) -> string(). callback to simple_bridge and then call sbw:host(?BRIDGE) inside of wf_context.erl inside of url/0. The Host header is never guaranteed to appear, and if that's the case we might be able to get it from the web server directly, as we can with cowboy, or we might be able to fallback to some reasonable value.
I'll try and think of a better patch later, but this one for now resolves the issue that I found where nitrogen was crashing when calling wf:url() on a cowboy TLS server.
@choptastic I'll come back and add more of a description later. I wrote a large summary twice before I realized my commits were failing because my GPG had expired.
Basically this merges in the
host
value that Cowboy knows when the HTTP header is missing, as it apparently is when running incowboy:start_tls/3
mode. I suspect this is related to TLS/SNI.As I think about this I think a better approach might be to add a new
host(req()) -> string().
callback tosimple_bridge
and then callsbw:host(?BRIDGE)
inside ofwf_context.erl
inside ofurl/0
. TheHost
header is never guaranteed to appear, and if that's the case we might be able to get it from the web server directly, as we can withcowboy
, or we might be able to fallback to some reasonable value.I'll try and think of a better patch later, but this one for now resolves the issue that I found where
nitrogen
was crashing when callingwf:url()
on acowboy
TLS server.