-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support compressed data #4506
support compressed data #4506
Conversation
2027981
to
693c9e9
Compare
quickwit/rest-api-tests/run_tests.py
Outdated
kvargs["data"] = load_data(body_from_file) | ||
kvargs["data"] = open(body_from_file, 'rb').read() | ||
if body_from_file.endswith("gz"): | ||
kvargs.setdefault("headers")["content-encoding"] = "gzip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a test with a gzip body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test already has gzip data (gharchive-bulk.json.gz
), I just deactivated the client side decompression
/// searchable, so the second approach is more suitable for this use case. | ||
async fn decompress_body(encoding: Option<String>, body: Bytes) -> Result<Bytes, warp::Rejection> { | ||
match encoding.as_deref() { | ||
Some("gzip" | "x-gzip") => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we improve this and make sure we return a 400 or a 406 with an error message for these errors. Right now all of them end up as a 500.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http error handling
28a4a98
to
619a964
Compare
619a964
to
d8a2102
Compare
d8a2102
to
e227ac4
Compare
closes #3990
#4215