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

RFC 5987 Encoding on content-disposition headers #1765

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Jan 7, 2025

Important

Update Content-Disposition headers to use RFC 5987 encoding for filenames in export_files and get_document_file.

  • Behavior:
    • Update Content-Disposition header to use RFC 5987 encoding for filenames in export_files and get_document_file.
    • Encode filenames using urllib.parse.quote to handle special characters.
  • Functions:
    • Modify export_files to set Content-Disposition with filename*=UTF-8''{encoded_filename}.
    • Modify get_document_file to set Content-Disposition with filename*=UTF-8''{encoded_filename}.

This description was created by Ellipsis for d28b645. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to d28b645 in 21 seconds

More details
  • Looked at 46 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. py/core/main/api/v3/documents_router.py:766
  • Draft comment:
    Consider checking if zip_name is ASCII and using filename instead of filename* for ASCII names to simplify the header.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces RFC 5987 encoding for filenames in Content-Disposition headers. This is a good practice for handling non-ASCII characters in filenames. However, the PR does not handle the case where the filename might already be ASCII, which could be optimized by using the simpler 'filename' parameter instead of 'filename*'.
2. py/core/main/api/v3/documents_router.py:1263
  • Draft comment:
    Consider checking if file_name is ASCII and using filename instead of filename* for ASCII names to simplify the header.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces RFC 5987 encoding for filenames in Content-Disposition headers. This is a good practice for handling non-ASCII characters in filenames. However, the PR does not handle the case where the filename might already be ASCII, which could be optimized by using the simpler 'filename' parameter instead of 'filename*'.

Workflow ID: wflow_p15cAlQShNgeIer8


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit 10b07a9 into main Jan 7, 2025
2 of 3 checks passed
@NolanTrem NolanTrem deleted the Nolan/RFC5987 branch January 7, 2025 07:10
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.

1 participant