mod_http: Use hostname from the correct context (thanks gryffus)
authorKim Alvefur <zash@zash.se>
Thu, 20 Feb 2014 18:08:55 +0000 (19:08 +0100)
committerKim Alvefur <zash@zash.se>
Thu, 20 Feb 2014 18:08:55 +0000 (19:08 +0100)
plugins/mod_http.lua

index 0689634ec704a0f08848b75d95fed076f852c96b..afcec06959a3f2fa1fa2de83a817cde949064df4 100644 (file)
@@ -42,7 +42,7 @@ local function get_base_path(host_module, app_name, default_app_path)
        return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host
                or module:get_option("http_paths", {})[app_name] -- Global
                or default_app_path)) -- Default
-               :gsub("%$(%w+)", { host = module.host });
+               :gsub("%$(%w+)", { host = host_module.host });
 end
 
 local ports_by_scheme = { http = 80, https = 443, };