Code Review changes. Remove duplicate tests.
This commit is contained in:
parent
1f8ab60e40
commit
76c2063be8
2 changed files with 9 additions and 180 deletions
|
|
@ -103,15 +103,15 @@ local function pick_new_upstream(self)
|
|||
end
|
||||
|
||||
local function should_set_cookie(self)
|
||||
if self.cookie_session_affinity.locations then
|
||||
if self.cookie_session_affinity.locations and ngx.var.host then
|
||||
local locs = self.cookie_session_affinity.locations[ngx.var.host]
|
||||
if locs == nil then
|
||||
-- Based off of wildcard hostname in ../certificate.lua
|
||||
local wildcardHostname, _, err = ngx.re.sub(ngx.var.host, "^[^\\.]+\\.", "*.", "jo")
|
||||
local wildcard_host, _, err = ngx.re.sub(ngx.var.host, "^[^\\.]+\\.", "*.", "jo")
|
||||
if err then
|
||||
ngx.log(ngx.ERR, "error: ", err);
|
||||
elseif wildcardHostname then
|
||||
locs = self.cookie_session_affinity.locations[wildcardHostname]
|
||||
elseif wildcard_host then
|
||||
locs = self.cookie_session_affinity.locations[wildcard_host]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue