Skip to content

Encode URL components, not whole URLs, in UrlEncodingAndDecoding - #2109

Closed
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/88650-url-encode
Closed

Encode URL components, not whole URLs, in UrlEncodingAndDecoding#2109
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/88650-url-encode

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

The three examples (Program.cs and tests) encoded the entire URL http://example.com/resource?foo=bar with space#fragment, which percent-escapes the ://, ? and # that give a URL its structure and produces an unusable string. This reworks all three to encode only the query-string value and interpolate it into the URL, keeping the visible comparison between the classes (space as + vs %20). Also retargets both projects to net10.0 and updates the MSTest/test SDK packages.

@
Encode URL components, not whole URLs, in UrlEncodingAndDecoding

The three examples encoded the entire URL, which destroys the ://, ?
and # that give a URL its structure and yields an unusable result. Encode
only the query-string value and interpolate it into the URL. Retarget to
net10.0 and update MSTest/test SDK packages.
@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant