-
Notifications
You must be signed in to change notification settings - Fork 251
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
Percent Signs in Object Names causes 400 error #656
Comments
Of course, there's lots of places where this needs handling. Currently I've found:
Maybe it'd be better to override the create request and catch it there? |
No new functionality is being added to this version of the SDK. The newer version is recommended for connecting to OpenStack clouds. I'd be happy to look into this issue if it affects the newer codebase. If you are not in a position to migrate, a short-term fix would be to urlencode the filename yourself before uploading and after retrieving. |
I've currently overridden guzzle's RequestFactory to urlencode the full path since that meant I only had to do it in one place. |
It's actually explicitly mentioned in the docs that urlencoding should be done before it hits the SDK - I'll close this. |
Some files that I've been trying to upload as part of a migration to Swift have been returning 400 errors, and I couldn't work out why, until I spotted that the file names had a percent in them which doesn't look like it gets escaped. I don't think Guzzle does any urlencoding, so it looks like OpenCloud needs to do that.
I think it's sufficient to do
preg_replace('/\%(?!\d{2})/', '%25', $objectName)
when requesting an object. Putting[]{}
in my object name was handled without errors.The text was updated successfully, but these errors were encountered: