Skip to content

Commit

Permalink
Merge pull request #186 from croessner/features
Browse files Browse the repository at this point in the history
Fix: Refactor backend server check in monitoring filter
  • Loading branch information
croessner authored Dec 9, 2024
2 parents 8daf527 + 1b0ffd2 commit d6f4340
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/lua-plugins.d/filters/monitoring.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ function nauthilus_call_filter(request)
if expected_server and server_host ~= expected_server then
server_host = expected_server
end

attributes["Proxy-Host"] = server_host

nauthilus_builtin.custom_log_add(N .. "_backend_server", server_host)

backend_result:attributes(attributes)
nauthilus_backend.apply_backend_result(backend_result)
end
end

if server_host == nil then
nauthilus_builtin.custom_log_add(N .. "_backend_server", "failed")
nauthilus_builtin.status_message_set("No backend servers are available")
if server_host == nil then
nauthilus_builtin.custom_log_add(N .. "_backend_server", "failed")
nauthilus_builtin.status_message_set("No backend servers are available")

return nauthilus_builtin.FILTER_ACCEPT, nauthilus_builtin.FILTER_RESULT_FAIL
return nauthilus_builtin.FILTER_ACCEPT, nauthilus_builtin.FILTER_RESULT_FAIL
end
end

return nauthilus_builtin.FILTER_ACCEPT, nauthilus_builtin.FILTER_RESULT_OK
Expand Down

0 comments on commit d6f4340

Please sign in to comment.