Browse Source

fix(scheme): fix scheme parsing

zhouzb 5 years atrás
parent
commit
311df2f8a6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      apps/emqx_auth_http/src/emqx_auth_http_app.erl

+ 3 - 2
apps/emqx_auth_http/src/emqx_auth_http_app.erl

@@ -55,10 +55,11 @@ translate_env(EnvName) ->
             URL = proplists:get_value(url, Req),
             #{host := Host0,
               path := Path0,
-              scheme := Scheme} = URIMap = uri_string:parse(add_default_scheme(URL)),
+              scheme := Scheme0} = URIMap = uri_string:parse(add_default_scheme(URL)),
+            Scheme = string:to_lower(Scheme0),  
             Port = maps:get(port, URIMap, case Scheme of
                                             "https" -> 443;
-                                            _ -> 80
+                                            "http" -> 80
                                         end),
             Path = path(Path0),
             {Inet, Host} = parse_host(Host0),