Uh oh!
There was an error while loading. Please reload this page.
Implement UriCreationOptions - #59173
Conversation
Includes DangerousDisablePathAndQueryCanonicalization
ghost
commented
Sep 15, 2021
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
ghost
commented
Sep 15, 2021
Tagging subscribers to this area: @dotnet/ncl Issue DetailsImplements a minimal subset of #59099: Not yet implemented: publicstructUriCreationOptions{publicUriKindUriKind{readonlyget;set;}publicboolAllowImplicitFilePaths{readonlyget;set;}}
|
| if (DisablePathAndQueryCanonicalization && (components & (UriComponents.Path | UriComponents.Query)) != 0) | ||
| { | ||
| throw new InvalidOperationException(SR.net_uri_GetComponentsCalledWhenCanonicalizationDisabled); | ||
| } |
There was a problem hiding this comment.
Offline discussion: I'm concerned that there's no way for the consumer to know if DisablePathAndQueryCanonicalization is set and avoid this exception. This method can also throw IOE for relative Uris, but there you can check IsAbsoluteUri first.
There was a problem hiding this comment.
This method can also throw IOE for relative Uris, but there you can check IsAbsoluteUri first.
In the current version this is unreachable for relative Uris (since UriKind hasn't been exposed yet), but I will keep it in mind when adding the rest of the API. It's not critical as it would always throw anyway, but the change wasn't intentional.
There was a problem hiding this comment.
I think we should consider adding a way to expose this, something like IsPathAndQueryCanonicalizationDisabled.
There was a problem hiding this comment.
Just to be super-clear: We can track that for 7.0, we do not consider it blocking attempt for 6.0 backport.
@geoffkizer please let us know if you disagree.
MihaZupan
commented
Sep 16, 2021
Test failure unrelated: #58356 |
| public bool DangerousDisablePathAndQueryCanonicalization | ||
| { | ||
| readonly get => _disablePathAndQueryCanonicalization; | ||
| set => _disablePathAndQueryCanonicalization = value; | ||
| } |
There was a problem hiding this comment.
Could you please explain what readonly get does, and link me to associated docs? Thank you
There was a problem hiding this comment.
karelz
commented
Sep 17, 2021
/backport to release/6.0-rc2 |
Started backporting to release/6.0-rc2: https://github.com/dotnet/runtime/actions/runs/1246572044 |
Fixes#52628
Fixes#58057
Implements a minimal subset of #59099:
The
Uriconstructor overloads and theDangerousDisablePathAndQueryCanonicalizationproperty ofUriCreationOptions.Not yet implemented: