-
Notifications
You must be signed in to change notification settings - Fork 58
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
Use swiftclient.utils.generate_temp_url #80
Conversation
6 similar comments
swift/storage.py
Outdated
@@ -360,7 +361,8 @@ def _path(self, name): | |||
path = urlparse.urlsplit(url).path | |||
msg = ('%s\n%s\n%s' % (method, expires, path)).encode() | |||
sig = hmac.new(self.temp_url_key, msg, sha1).hexdigest() | |||
url = url + '?temp_url_sig=%s&temp_url_expires=%s' % (sig, expires) | |||
tmp_path = generate_temp_url(path, expires, sig, method, absolute=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not pass sig
here, but self.temp_url_key
, according to the docs.
swift/storage.py
Outdated
@@ -357,11 +355,8 @@ def _path(self, name): | |||
# Are we building a temporary url? | |||
if self.use_temp_urls: | |||
expires = int(time() + int(self.temp_url_duration)) | |||
method = 'GET' | |||
path = urlparse.urlsplit(url).path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be :
path = urlparse.unquote(urlparse.urlsplit(url).path)
..because name
was quoted above (line 355).
3 similar comments
4 similar comments
@Blacktorn This one is more than ready now 😃 |
@Blacktorn Once again ready for merge. |
This reverts commit e2618ea.
Suggestion for #79