As of issue #38 / delimeters was encoded to %2F. This was fixed by changing encodeURIComponent to encodeURI. However, this raised an issue of + signs not working in directory names and this was fixed in PR #41 by changing these functions back to the original.
The difference between encodeURI and encodeURIComponent is that ;/?:@&=+$,# are not escaped in encodeURI (ECMA Docs).
On this project encodeURI is not good, as it does not escape characters that could be in file/dir names and S3 does not understand them when they're not escaped.
On the other hand encodeURIComponent is encoding / as well, which works but does not look good when copying the URL of a file.
This PR fixes the issues in these functions by creating a new function encodePath, giving the best of two functions utilizing encodeURI and encoding the missing characters that encodeURIComponent escapes compared to encodeURI.
As of issue #38
/
delimeters was encoded to%2F
. This was fixed by changingencodeURIComponent
toencodeURI
. However, this raised an issue of+
signs not working in directory names and this was fixed in PR #41 by changing these functions back to the original.The difference between
encodeURI
andencodeURIComponent
is that;/?:@&=+$,#
are not escaped inencodeURI
(ECMA Docs).On this project
encodeURI
is not good, as it does not escape characters that could be in file/dir names and S3 does not understand them when they're not escaped.On the other hand
encodeURIComponent
is encoding/
as well, which works but does not look good when copying the URL of a file.This PR fixes the issues in these functions by creating a new function
encodePath
, giving the best of two functions utilizingencodeURI
and encoding the missing characters thatencodeURIComponent
escapes compared toencodeURI
.