Re: correct answer for lookup in backend

Remi Gacogne via Pdns-users <[email protected]>
Newsgroups gmane.network.dns.powerdns.user
Message-ID <[email protected]>
Hi,

On 29/11/2023 21:23, Alexis Fidalgo via Pdns-users wrote:
> Quick question, when using JSON/RPC in remote backend with http connector.
> 
> {"method":"lookup", "parameters":{"qtype":"ANY", "qname":"www.example.com.", "remote":"192.0.2.24", "local":"192.0.2.1", "real-remote":"192.0.2.24", "zone-id":-1}}
> 
> must be answered with
> 
> {"result":[{"qtype":"A", "qname":"www.example.com", "content":"203.0.113.2", "ttl": 60}]}
> 
> If theres no records to answer, which is the correct answer?
> 
> 1. {“result”:[]}
> 2. {“result”:false}

The expected answer is an empty array. The current code treats a 
non-array value as an empty array but I wouldn't rely on this behaviour.

Best regards,
-- 
Remi Gacogne
PowerDNS.COM BV - https://www.powerdns.com/

_______________________________________________
Pdns-users mailing list
[email protected]
https://mailman.powerdns.com/mailman/listinfo/pdns-users
OpenPGP_signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE1jAMq8v0abvjkuUDogjtT4r1hEYFAmVoQtcACgkQogjtT4r1
hEYjDQf/QCUGfD2oITaMEbkvN/dpfbmH+g/FidYr+hUmiugRSGD7P9jl0UxyQE53
ROicN/8WRpHCf4kE2LuCYUGsg6e+ENtO0HifMaAHhainm/iJdZZhFKXksUBiZNSe
XivGAH76aYh9oREZI0npBNaiF/HfjRDrbx38pPeUrfm5dolT+n/eBX+050iEqfwL
uWpYvUEramoCIaLLCxHCeusWWKAchX2QH0Cup+6UHfPKUlIQj46yPUpJ5HXQs0gT
YY9NiV0IPm2+9QhpIagj2elpY2g7gkwVgNgphBQjV3p9G+9DrBHHidFZpL71Ki7I
pf3eJiSxCq5f3WaadFZ0vDbA0w8z/g==
=KDe3
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.