Skip to content

Commit

Permalink
请求头 escape_uri 改为可选操作
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopal committed Jun 11, 2018
1 parent 2af60f5 commit e35c7c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oidc-access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ if oidc_access and oidc_access ~= "" then
ngx.var[name] = claims and claims[claim]
end
for name,claim in pairs(cfg["claim_headers"] or {}) do
ngx.req.set_header(name, claims and claims[claim] and ngx.escape_uri(claims[claim]))
local claim_escape = claim:match("^(.+)%%$")
local claim_val = claims and claims[claim_escape or claim]
ngx.req.set_header(name, claim_val and claim_escape and ngx.escape_uri(claim_val) or claim_val)
end
end

0 comments on commit e35c7c3

Please sign in to comment.