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:
parent
2eb3e3f994
commit
bc39b433bb
5 changed files with 38 additions and 19 deletions
|
@ -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)].
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue