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

excaping issue #28

Open
ddalacu opened this issue Jan 25, 2021 · 3 comments
Open

excaping issue #28

ddalacu opened this issue Jan 25, 2021 · 3 comments

Comments

@ddalacu
Copy link

ddalacu commented Jan 25, 2021

While writing a some code for uploading files to s3 buckets i encountered a bug where when building the canonicalRequest your code would use "request.RequestUri.AbsolutePath" but that would already escape part of the request uri example: "/Assets/Translations/General/Chinese (Simplified).json" would become "/Assets/Translations/General/Chinese%20(Simplified).json" when accessing AbsolutePath property, i fixed this by calling Uri.UnescapeDataString(request.RequestUri.AbsolutePath)
The final code looks like this for me:

var unescaped = Uri.UnescapeDataString(request.RequestUri.AbsolutePath);
canonicalRequest.Append(string.Join("/", unescaped.Split('/').Select(Uri.EscapeDataString)) + "\n");
Maybe this it was my bad somewhere but maybe this can help you.

@ronenfe
Copy link
Collaborator

ronenfe commented Mar 23, 2022

Are you saying we shouldn't let it get escaped?

@ddalacu
Copy link
Author

ddalacu commented Apr 18, 2022

Hello, yes i think you don't need to do that. But you should do some separate tests to confirm the bug.

@nzbart
Copy link

nzbart commented Jan 19, 2023

I've also run into this issue with spaces in the file path. Is there a fix?

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

No branches or pull requests

3 participants