-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(request_builder): encode unresolved path string prior to path par…
…ameter insertion This commit modifies RequestBuilder.ResolveRequestURL() slightly so that the passed-in path string (unresolved, potentially containing special characters and path parameter references) is URL-encoded prior to replacing path param references with their corresponding encoded path param values. This ensures that the URL string passed to http.NewRequest() by RequestBuilder.Build() will be properly encoded (escaped) such that all special characters appearing in path segments are converted to their %nn equivalents, but yet any escaped characters within the encoded path param values are NOT decoded. This avoids a quirk in the url.Parse() method that is invoked by the http.NewRequest() method. This change is needed in order to properly support a scenario where: 1. a path parameter value contains one or more embedded slashes and is therefore escaped AND 2. the unresolved path string ALSO contains other special characters needing to be escaped Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
- Loading branch information
Showing
4 changed files
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters