The error handler's BufferOpts are BufferResponse (because of the reference to json_body), whereas the endpoint's are BufferNone. So the proxy response's body is not buffered, and resp_json_body_headers is null.
In order to make this config work, api level error handlers must affect api level endpoints' BufferOpts.
Note: Test_StoreInvalidBackendResponse with its configuration testdata/integration/error_handler/06_couper.hcl:
only works because both BufferOpts have BufferResponse set, the endpoint's because of the openapi block, the error handler's because of a reference to json_body.
Consider the following config:
The error handler's BufferOpts are
BufferResponse
(because of the reference tojson_body
), whereas the endpoint's areBufferNone
. So the proxy response's body is not buffered, andresp_json_body_headers
isnull
.In order to make this config work,
api
level error handlers must affect api level endpoints' BufferOpts.Note: Test_StoreInvalidBackendResponse with its configuration testdata/integration/error_handler/06_couper.hcl:
only works because both BufferOpts have
BufferResponse
set, the endpoint's because of theopenapi
block, the error handler's because of a reference tojson_body
.