Add/Modify Url Encoding/Decoding for IIS UrlRewrite #40483
+74
−3
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.
Add Url encoding and modify url Encoding for IIS UrlRewrite
Add Segment Decode class using Uri.UnescapeDataString and plug it into Input Parser.
Modify Url Encode so that it uses Uri.DecodeDataString.
Description
As was suggested I have changed Decode Data String to Unescape Data String which is recommended by docs.
For Url Decoding I have used analogical function UnescapeDataString. I have written unit tests for decoding covering opposite cases to encoding. I have also written tests for InputParser checking whether decode parameter goes into correct case and correct rule is added.
I wasn't sure if I was supposed to write performance tests since the motivation of changing from UrlEncode was that it's slow. If these test are desired I can add them.
Fixes #5985