From bc39b433bb20c44690b75bf28539983517002268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 6 Dec 2017 14:05:30 +0100 Subject: 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. --- src/cowboy_req.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cowboy_req.erl') diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl index e38b76c..552f409 100644 --- a/src/cowboy_req.erl +++ b/src/cowboy_req.erl @@ -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)]. -- cgit v1.2.3