]> git.ipfire.org Git - thirdparty/pdns.git/commit
Fix country()/countryCode() mixup in example Lua Record 13714/head
authorEdward Dore <5480052+spheron1@users.noreply.github.com>
Sun, 14 Jan 2024 11:22:29 +0000 (11:22 +0000)
committerGitHub <noreply@github.com>
Sun, 14 Jan 2024 11:22:29 +0000 (11:22 +0000)
commit784b67fb38895edd6a96da612c8e6f57801877dc
tree516bf7d4b8362f765cb3c38e521fa05118e1ccb7
parent381020d6e9b9edb0079fd99d0f53dec7908ece2e
Fix country()/countryCode() mixup in example Lua Record

The country() function returns true if the country code for the query source IP address matches the country code passed to the function.
The countryCode() function doesn't take any arguments and just returns the country code of the query source IP address.

For this example, we're checking if the country for the query source IP address is "US" and expecting a true/false response, so country() is the correct function to use.
Alternatively, this would be something like "if countryCode() == 'US' then return...".
docs/lua-records/index.rst