Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR gets most tests to pass using
net/url.String()
for url escaping. The only failing tests are forEncodeNecessaryEscapes
andDecodeUnnecessaryEscapes
, which rely on implementation details ofnet/url
andurlesc
.It is remarkably difficult to avoid
net/url
's escaping logic, especially if you try to hold it "right" by using.String()
,.EscapedPath()
,PathJoin()
, &c. My opinion is thatnet/url
has had this escaping logic for years at this point and likely folks should be OK with it at this point.In addition, the
TestEncodeNecessaryEscapesAll
is vague; as written, it tests not only the path but also query and fragment escaping, since the url string contains?
and#
. It is unclear to me if we want to just test path escaping or if we care about query and fragment escaping too?Resolves #14 unsatisfactorily.