Adds some simple exception passing for tika-server proxy.
If an exception is found, it is added to response["message"].
The response status is not updated (see below)
Also adds missing EOF lines.
Notes on response status (and slight ramble):
Because of the nature of proxy passing, it's not possible to update the nginx status for multipart requests inside the filter_body_by_lua block, so these exceptions will still return as 200s.
This is because nginx returns the header response before the body response, and we don't have access to the contents of the full response body before the headers have already been sent back. We don't know if an error has occurred until we have all of the contents, so unless an internal server error happens inside tika, the response is always 200 here.
This could be bypassed by not doing a proxy pass and instead manually requesting tika with a rewrite_by_lua block. But that is a lot of work and this already works, maybe something to think of for a v2.
Checklists
Pre-Review Checklist
[x] this PR has a meaningful title
[x] this PR links to all relevant github issues that it fixes or partially addresses
[x] if there is no GH issue, please create it. Each PR should have a link to an issue
[x] this PR has a thorough description
[x] Covered the changes with automated tests
[x] Tested the changes locally
[x] Added a label for each target release version (example: v7.13.2, v7.14.0, v8.0.0)
[x] Considered corresponding documentation changes
[x] Contributed any configuration settings changes to the configuration reference
Related to https://github.com/elastic/enterprise-search-team/issues/4576
Adds some simple exception passing for tika-server proxy.
response["message"]
.Also adds missing EOF lines.
Notes on response status (and slight ramble):
Because of the nature of proxy passing, it's not possible to update the nginx status for multipart requests inside the
filter_body_by_lua
block, so these exceptions will still return as 200s. This is because nginx returns the header response before the body response, and we don't have access to the contents of the full response body before the headers have already been sent back. We don't know if an error has occurred until we have all of the contents, so unless an internal server error happens inside tika, the response is always 200 here.This could be bypassed by not doing a proxy pass and instead manually requesting tika with a
rewrite_by_lua
block. But that is a lot of work and this already works, maybe something to think of for a v2.Checklists
Pre-Review Checklist
v7.13.2
,v7.14.0
,v8.0.0
)