Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@oaleynik
Copy link
Contributor

Closes #7

@oaleynik
Copy link
Contributor Author

@kellysutton I'm debating with myself what is better + or %20 in this case. I used + as S3 console does it.

@kellysutton
Copy link
Contributor

Not quite sure what will be best. Our newest hire, @paulstraw, can help you get to the bottom of things. Thanks for the PR!

@paulstraw
Copy link
Contributor

I just did some digging on this. This blog post has a great overview, but basically it looks like since this is a path and not a query, the space characters should be encoded as %20. Let's go with that for now, if you don't mind changing it.

After this is merged in, I'm actually planning to more "fully" sanitize passed paths according to the "reserved" section of IETF RFC 3986 (since we unfortunately can't just URI.encode them). I'll be digging into how to best make that happen in #9.

@paulstraw
Copy link
Contributor

@oaleynik, it looks like URI.encodeReserved would be a great fit here. If you want to make that change, I'll be happy to merge it in!

@oaleynik
Copy link
Contributor Author

@paulstraw thanks for your comment. Yeah, I knew that direct string manipulation is not perfect. Your suggestion to use URI.encodeReserved works perfectly. Thanks!

@oaleynik
Copy link
Contributor Author

As a side note - I saw that post related to URL encoding when I was digging on this issue. I don't think that the + is wrong entirely or against IEFT specs. Also, it looks better in the URL:

https://my-social-network.imgix.net/users/image%201.png?s=193462f12470fe53927d0cf21e07d404
https://my-social-network.imgix.net/users/image+1.png?s=193462f12470fe53927d0cf21e07d404

Anyway - I subscribed to #9 to follow your findings. Thanks again!

paulstraw added a commit that referenced this pull request Dec 11, 2015
Replace space and other characters in path with their escaped versions
@paulstraw paulstraw merged commit a191283 into imgix:master Dec 11, 2015
@oaleynik oaleynik changed the title Replace space in path with the '+' character Escape space in the path component Dec 11, 2015
@ericdeansanchez
Copy link
Contributor

🎉 This PR is included in version 0.3.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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