0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Properly handle OPTIONS * requests

Support for these was broken during the development
of Cowboy 2.0. It is now fixed and better handled
than it ever was.
This commit is contained in:
Loïc Hoguin 2017-12-06 14:05:30 +01:00
parent 2eb3e3f994
commit bc39b433bb
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
5 changed files with 38 additions and 19 deletions

View file

@ -228,8 +228,10 @@ uri(#{scheme := Scheme0, host := Host0, port := Port0,
end,
Host = maps:get(host, Opts, Host0),
Port = maps:get(port, Opts, Port0),
Path = maps:get(path, Opts, Path0),
Qs = maps:get(qs, Opts, Qs0),
{Path, Qs} = case maps:get(path, Opts, Path0) of
<<"*">> -> {<<>>, <<>>};
P -> {P, maps:get(qs, Opts, Qs0)}
end,
Fragment = maps:get(fragment, Opts, undefined),
[uri_host(Scheme, Scheme0, Port, Host), uri_path(Path), uri_qs(Qs), uri_fragment(Fragment)].