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

"Save Response Body" to get output filename from Content-Disposition (if available) #924

Closed
mbronk opened this issue Nov 14, 2021 · 2 comments · Fixed by #925
Closed

"Save Response Body" to get output filename from Content-Disposition (if available) #924

mbronk opened this issue Nov 14, 2021 · 2 comments · Fixed by #925

Comments

@mbronk
Copy link
Contributor

mbronk commented Nov 14, 2021

Currently, the Save Response Body option does auto-pick an extension based on Content-Type
Ref:

const extension = MimeUtility.getExtension(this.activeResponse.contentType, this.settings.mimeAndFileExtensionMapping);

It would be nice, if it also picked up the server-provided name, provided through Content-Disposition (for "downloads").
E.g. save to test.zip, for a Content-Disposition: attachment; filename="test.zip" (similar to what curl's --remote-name --remote-header-name does)

@mbronk mbronk changed the title "Save Response Body" to honor Content-Disposition "Save Response Body" to get output filename from Content-Disposition (if available) Nov 14, 2021
@Huachao
Copy link
Owner

Huachao commented Nov 29, 2021

@mbronk this has been published in the latest version 0.24.6 and you can have a try

@mbronk
Copy link
Contributor Author

mbronk commented Nov 29, 2021

@Huachao - Just gave 0.24.6 a spin - works nicely! Thanks for integrating this enhancement.

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 a pull request may close this issue.

2 participants