Remove directory from disposition header #3515
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.