Conversation
c3fbd9e to
2d44993
Compare
|
@rhafer I thought I'd give this a shot, not sure if it's the best approach though. Also maybe there's a better utility method for encoding hashes? I think fully encoding the URL (including all slashes etc.) might be a bit too much. |
Thanks for looking into this. I think just replacing the Provided that the |
2d44993 to
246fe8c
Compare
The |
| for i := range pathParts { | ||
| pathParts[i] = url.PathEscape(pathParts[i]) | ||
| } | ||
| encodedPath := strings.Join(pathParts, "/") |
There was a problem hiding this comment.
instead of the loop and the strings.Join I'd suggest to use:
encodedPath, err := url.JoinPath("", parts...)
That does the whole thing in one go.
There was a problem hiding this comment.
Almost, it loses the leading /. I changed it to url.JoinPath("/", parts...). Which results in it always including a leading /, even if the given path doesn't have it initially. Which would probably not be an issue...? Or do you think it's better to check for that as well?
There was a problem hiding this comment.
When do you get a leading /? Does that ever happen?
There was a problem hiding this comment.
In my observations, the given path always has a leading /. So it just stays this way. But if there would be a path without it, encodedPath would still end up with a leading / now. But again, that doesn't seem to happen, at least not that I can see.
There was a problem hiding this comment.
Ok. Then your change should be fine.
Encodes singed URLs so they can be resolved properly.
246fe8c to
4545dd5
Compare
Encodes singed URLs so they can be resolved properly.
fixes opencloud-eu/opencloud#1808