mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-01 07:50:26 +02:00
xds: fix misdirected script (#1895)
This commit is contained in:
parent
51be8ffd76
commit
5be71b8e07
3 changed files with 5 additions and 4 deletions
|
@ -14,10 +14,11 @@ function envoy_on_response(response_handle)
|
||||||
|
|
||||||
local authority =
|
local authority =
|
||||||
dynamic_meta:get("envoy.filters.http.lua")["request.authority"]
|
dynamic_meta:get("envoy.filters.http.lua")["request.authority"]
|
||||||
|
local expected_authority = "%s"
|
||||||
|
|
||||||
-- if we got a 404 (no route found) and the authority header doens't match
|
-- if we got a 404 (no route found) and the authority header doesn't match
|
||||||
-- assume we've coalesced http/2 connections and return a 421
|
-- assume we've coalesced http/2 connections and return a 421
|
||||||
if headers:get(":status") == "404" and authority ~= "%s" then
|
if headers:get(":status") == "404" and authority ~= expected_authority then
|
||||||
headers:replace(":status", "421")
|
headers:replace(":status", "421")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -312,7 +312,7 @@ func (srv *Server) buildMainHTTPConnectionManagerFilter(
|
||||||
}
|
}
|
||||||
if tlsDomain != "" && tlsDomain != "*" {
|
if tlsDomain != "" && tlsDomain != "*" {
|
||||||
fixMisdirectedLua := marshalAny(&envoy_extensions_filters_http_lua_v3.Lua{
|
fixMisdirectedLua := marshalAny(&envoy_extensions_filters_http_lua_v3.Lua{
|
||||||
InlineCode: fmt.Sprintf(luascripts.FixMisdirected),
|
InlineCode: fmt.Sprintf(luascripts.FixMisdirected, tlsDomain),
|
||||||
})
|
})
|
||||||
filters = append(filters, &envoy_http_connection_manager.HttpFilter{
|
filters = append(filters, &envoy_http_connection_manager.HttpFilter{
|
||||||
Name: "envoy.filters.http.lua",
|
Name: "envoy.filters.http.lua",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue