Skip to content
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

fix: return valid gzip when LAPIS returns an error response #657

Merged

Conversation

fengelniederhammer
Copy link
Contributor

Apparently the following happened:

  • The gzip stream eagerly writes the gzip header to the underlying stream (in its constructor)
  • an error occurs
  • Spring's error handling resets the response buffer (erasing the gzip header)
  • The exception handler writes a messages, which gets gzip compressed.

Fix by: Delay initializing the gzip output stream until something is written to it.

resolves #656

PR Checklist

  • [ ] All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

Apparently the following happened:
* The gzip stream eagerly writes the gzip header to the underlying stream (in its constructor)
* an error occurs
* Spring's error handling resets the response buffer (erasing the gzip header)
* The exception handler writes a messages, which gets gzip compressed.

Fix by: Delay initializing the gzip output stream until something is written to it.
@fengelniederhammer fengelniederhammer force-pushed the 656-bad-request-returns-invalid-gzip-compressed-data branch from 1769fae to e5eaeff Compare February 20, 2024 16:47
Copy link
Contributor

@JonasKellerer JonasKellerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fengelniederhammer fengelniederhammer merged commit db1c6cb into main Feb 21, 2024
10 checks passed
@fengelniederhammer fengelniederhammer deleted the 656-bad-request-returns-invalid-gzip-compressed-data branch February 21, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bad request returns invalid gzip compressed data
2 participants