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

chore: add content disposition and length in headers for binary #124

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

brunopacheco1
Copy link
Collaborator

@brunopacheco1 brunopacheco1 commented Sep 26, 2024

Summary by Sourcery

Enhance the response headers in the DatasetQueryApiImpl class by adding 'Content-Disposition' and 'Content-Length' to support better file download functionality.

Enhancements:

  • Add 'Content-Disposition' and 'Content-Length' headers to the response in the DatasetQueryApiImpl class to improve file download handling.

Copy link

sourcery-ai bot commented Sep 26, 2024

Reviewer's Guide by Sourcery

This pull request adds Content-Disposition and Content-Length headers to the HTTP response when retrieving a dataset in a specific format. These additions improve the handling of binary data and provide more information to the client about the response content.

Sequence Diagram

No sequence diagram generated.

File-Level Changes

Change Details Files
Add Content-Disposition and Content-Length headers to the HTTP response
  • Add Content-Disposition header with attachment and filename
  • Add Content-Length header with the content length
src/main/java/io/github/genomicdatainfrastructure/discovery/api/DatasetQueryApiImpl.java

Tips and commands
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @brunopacheco1 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider sanitizing 'id' and 'format' variables before using them in the Content-Disposition header to prevent potential security issues with malformed filenames.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@brunopacheco1 brunopacheco1 merged commit 6fd4e09 into main Sep 26, 2024
3 checks passed
@brunopacheco1 brunopacheco1 deleted the add-content-disposition branch September 26, 2024 10:02
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.

3 participants