-
Notifications
You must be signed in to change notification settings - Fork 19
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
Client.GetObject to SwiftStack fails when object path contains space characters #10
Comments
I second this issue. It is still present in the library. Your approach seems to be ok, the only problem I see is that it only accounts for space, but not other characters that when encoded may end up changing the original name of the file. |
After forking the project, I see the following in the code (StringExtensions.cs):
Which would solve this issue, however, when installing the Nuget Package I don't see the above. Could it be possible that the fix was added but the package was never updated to have it? |
I took the liberty of packaging the latest and greatest source code version and publishing it as a nuget package. It's not best practice as you won't get any updates if the original authors make a change, but at least is out there so you can easily install it as a package with the fix to this issue. https://www.nuget.org/packages/SwiftClientUpdated/2.1.5-beta#usedby-body-tab |
@alejandro1585 why not make a pull request and contribute to this repo? |
@cristipufu I see the enhancement is already part of the master branch; however, it seems like the nuget package does not have this change. I see the commit was made by merqlove (see screenshot). As a result, there's no need for a PR on my end, perhaps a new version of the package can be released with the latest and greatest. What are your thoughts? |
The URL being sent to SwiftStack appears to contain "+" characters in place of " " (space) characters. SwiftStack apparently wants spaces to be encoded as %20. I modified line 34 of SwiftUrlBuilder.cs to read:
var url = storageUrl + "/" + containerId.Encode().Replace("+","%20") + "/" + objectId.Encode().Replace("+", "%20");
And it seems to work. I don't know, however, if this is technically correct or might break something else.
The text was updated successfully, but these errors were encountered: