I have a url
/api/namespace/{namespace}?query={query}
namespace path param value is AWS/EC2 (please note forward slash '/' in path param)
Now the issue is:
- fetch-plus uses encodeURI (see this line in fetch-plus)
path = normalizeFunc(path.map(compute).map(encodeURI).join("/"));
So this escapes forward-slash, and hence the resulting url from fetch-plus is invalid
/api/namespace/AWS/EC2?query=1
- If I use encodeURIComponent for the path param myself before passing to fetch-plus,
encodeURIComponent('AWS/EC2') = AWS%2FEC2
valid path before fetch-plus:
/api/namespace/AWS%2FEC2?query=1
path converted in fetch-plus:
/api/namespace/AWS%252F?query=1
Notice that %2F is converted to %252F which is wrong. This is because of encodeURI.
So we cannot use fetch-plus in this scenario.
Please take a look.
I have a url
/api/namespace/{namespace}?query={query}
namespace path param value is AWS/EC2 (please note forward slash '/' in path param)
Now the issue is:
path = normalizeFunc(path.map(compute).map(encodeURI).join("/"));
So this escapes forward-slash, and hence the resulting url from fetch-plus is invalid
/api/namespace/AWS/EC2?query=1
encodeURIComponent('AWS/EC2') = AWS%2FEC2
valid path before fetch-plus:
/api/namespace/AWS%2FEC2?query=1
path converted in fetch-plus:
/api/namespace/AWS%252F?query=1
Notice that %2F is converted to %252F which is wrong. This is because of encodeURI.
So we cannot use fetch-plus in this scenario.
Please take a look.