]> git.ipfire.org Git - thirdparty/pdns.git/commit
Try harder to return response in the same type as the request. 15969/head
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 8 Aug 2025 06:31:22 +0000 (08:31 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 8 Aug 2025 08:04:43 +0000 (10:04 +0200)
commitd970ca9d3189dcc7a2d393628477b4e776748702
treef66801248ac06d7759713012160b92bc67989dbf
parentda2f4580108583b27f2554e8b06737c9489061c5
Try harder to return response in the same type as the request.

We still heed the `accept' header to choose the preferred content type of
the answer, but if it is missing, instead of defaulting to plain text, we
try to match the content type of the request.

This means that errors to json requests will now always get returned as
json, unless the `accept' header requires a different type.

Fixes: #7097
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/webserver.cc
regression-tests.api/test_Zones.py