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

Allow custom Content-Disposition filename in #create_temp_url method #452

Closed

Conversation

vala
Copy link

@vala vala commented Oct 9, 2018

Hi there,

To follow up on #338 I added the support for custom file names in Swift's temp url generation method Fog::OpenStack::Storage::Real#create_temp_url.

I found no tests for the #create_temp_url method so I did not write any.

Note that the param is always passed, even when the :filename option isn't provided since the Swift service will simply use the last member of the path as the content disposition filename by default, even if the filename= param is passed an empty value.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 9, 2018

Build succeeded.

@gildub
Copy link
Collaborator

gildub commented Oct 10, 2018

@vala, LGTM. Any chance you could add some tests? Obviously we inherited disjointed tests but we've got to progressively fill up the blanks.

temp_url_options = {
:scheme => scheme,
:host => host,
:port => port,
:path => object_path_escaped,
:query => "temp_url_sig=#{sig}&temp_url_expires=#{expires}"
:query => "temp_url_sig=#{sig}&temp_url_expires=#{expires}&filename=#{filename}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Filename needs to be filtered out if the parameter is empty.

@gildub
Copy link
Collaborator

gildub commented Nov 23, 2018

Actually the option need to be filtered if empty, please see inline.

@vala
Copy link
Author

vala commented Nov 28, 2018

Why do we need to filter that param out ?

On my Swift instance, if the filename is empty (&filename=) the returned Content-Disposition header will not contain any filename, just like when you do not pass the &filename= param.

Isn't that your case ?

@NikosVlagoidis
Copy link

Isn't this fixed here ?

@ares
Copy link
Collaborator

ares commented Feb 4, 2022

I'm sorry for the delay, there's a conflict now. I think this is no longer relevant as the query can contain multiple keys. Please let me know if I'm missing something, otherwise I think we can now close the PR.

@ares
Copy link
Collaborator

ares commented Feb 15, 2022

Closing now, please reopen if I missed anything.

@ares ares closed this Feb 15, 2022
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.

4 participants