dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
725 stars 1.56k forks source link

Add note about UrlEncode #10506

Closed ManickaP closed 3 weeks ago

ManickaP commented 3 weeks ago

UrlEncode is suitable only for query segment or x-www-form-urlencoded content. Also the list of unescaped punction doesn't follow neither URI RFC (old or new) nor any other spec I could find.

learn-build-service-prod[bot] commented 3 weeks ago

Learn Build status updates of commit 11eb380:

:warning: Validation status: warnings

File Status Preview URL Details
xml/System.Net/WebUtility.xml :warning:Warning View Details

xml/System.Net/WebUtility.xml

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

learn-build-service-prod[bot] commented 3 weeks ago

Learn Build status updates of commit 216c332:

:warning: Validation status: warnings

File Status Preview URL Details
xml/System.Net/WebUtility.xml :warning:Warning View Details

xml/System.Net/WebUtility.xml

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

learn-build-service-prod[bot] commented 3 weeks ago

Learn Build status updates of commit 4c2ebf8:

:white_check_mark: Validation status: passed

File Status Preview URL Details
xml/System.Net/WebUtility.xml :white_check_mark:Succeeded View

For more details, please refer to the build report.

For any questions, please:

MihaZupan commented 3 weeks ago

Also the list of unescaped punction doesn't follow neither URI RFC (old or new) nor any other spec I could find.

https://github.com/dotnet/runtime/blob/770df102b0dfbf16c22ef64a270a989495cfe145/src/libraries/System.Private.CoreLib/src/System/Net/WebUtility.cs#L572

The code mentions https://datatracker.ietf.org/doc/html/rfc1738 that includes this bit:

safe           = "$" | "-" | "_" | "." | "+"
extra          = "!" | "*" | "'" | "(" | ")" | ","

but even that doesn't match the characters used 😄