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 file naming on Safari downloads #107

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

elmiomar
Copy link
Contributor

This PR addresses and resolves an issue encountered in the Safari browser, where downloaded files were named "download" regardless of their intended filenames. The root cause was the absence of the "attachment" keyword in the Content-Disposition header. Prefixing the filename in the Content-Disposition header with "attachment" ensures that the specified filename overrides the download attribute content in Safari. In Chrome and Firefox, the filename specified in the Content-Disposition header takes precedence and is used for the downloaded file, regardless of the presence or absence of the "download" attribute in the anchor tag.

Testing using oar-docker was done across all three browsers: Safari, Chrome, and Firefox. The tests confirmed that files are now downloaded using the names specified in the Content-Disposition header.

@elmiomar elmiomar requested a review from RayPlante March 29, 2024 14:40
@elmiomar elmiomar self-assigned this Mar 29, 2024
Copy link
Collaborator

@RayPlante RayPlante left a comment

Choose a reason for hiding this comment

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

confirmed working on testdata

@RayPlante RayPlante merged commit 38d2f58 into integration Apr 12, 2024
2 checks passed
@RayPlante RayPlante deleted the fix/safari-download branch April 12, 2024 20:43
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.

2 participants