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

Remove directory from disposition header #3515

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

dbutenhof
Copy link
Member

PBENCH-1240

Now that the dashboard supports download of tarball inventory, I observed that the generated filename included a dataset-name prefix. This is because the content disposition header allows only a name, not a path, and the browser is trying to be "helpful" by converting the <dataset-name>/<filename> string, replacing the disallowed / with _. The result is ugly and unexpected.

NOTE: although the Mozilla guidelines try to suggest that the filename must be enclosed in quotes, this conflicts with the RFC, and Werkzeug's send_file is "reluctant" to include quotes (plus it's ugly to construct). Therefore, this doesn't attempt to insert the (presumably unnecessary) quotes. (And note also that, despite the ugly name, the current TOC download works without a quoted filename in Chrome.)

Instead, report only the name of the file. Add unit and functional test validation.

PBENCH-1240

Now that the dashboard supports download of tarball inventory, I observed that
the generated filename included a dataset-name prefix. This is because the
content disposition header allows only a name, not a path, and the browser is
trying to be "helpful" by converting the `<dataset-name>/<filename>` string,
replacing the disallowed `/` with `_`. The result is ugly and unexpected.

NOTE: although the Mozilla guidelines try to suggest that the filename must be
enclosed in quotes, this conflicts with the RFC, and Werkzeug's `send_file` is
"reluctant" to include quotes (plus it's ugly to construct). Therefore, this
doesn't attempt to insert the (presumably unnecessary) quotes. (And note also
that, despite the ugly name, the current TOC download works without a quoted
filename in Chrome.)

Instead, report only the name of the file. Add unit and functional test
validation.
@dbutenhof dbutenhof added API Of and relating to application programming interfaces to services and functions Signal Of and relating to signal integration work labels Aug 7, 2023
@dbutenhof dbutenhof self-assigned this Aug 7, 2023
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

👍

(Except for an example of why one function should not document the behavior of another function....)

@dbutenhof dbutenhof added Server and removed Signal Of and relating to signal integration work labels Aug 7, 2023
@dbutenhof dbutenhof merged commit 9b071de into distributed-system-analysis:main Aug 7, 2023
3 checks passed
@dbutenhof dbutenhof deleted the dispose branch August 7, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Of and relating to application programming interfaces to services and functions Server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants