Skip to content

Uninitialised Warn possible when using API Key policy on server level #5836

Closed
@j1m-ryan

Description

@j1m-ryan

Describe the bug
When using an API Key policy on the server level, it is possible to see an NGINX warning about an uninitialsed variable. This happens when visiting an undefined route.

To Reproduce

  1. Deploy the example in api key folder. (which has routes and /tea and /coffee but not /)
  2. curl cafe.example.com/
  3. See warn in console.
2024/06/24 15:21:43 [warn] 36#36: *4 using uninitialized "header_query_value" variable, client: 10.244.0.1, server: cafe.example.com, request: "GET / HTTP/1.1", subrequest: "/_validate_apikey_njs", host: "cafe.example.com"
10.244.0.1 - - [24/Jun/2024:15:21:43 +0000] "GET / HTTP/1.1" 401 179 "-" "curl/8.6.0" "-"

Expected behavior
Reaching an undefined route which is behind an API Key policy, should not have a warning in the logs.

Your environment

  • Version of the Ingress Controller - v3.6.0-snapshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue reporting a potential bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions