UrlHelperExtensions.ActionLink docs are misleading regarding requiring protocol and host
#42 949 ouverte le 27 juil. 2022
Métriques du dépôt
- Stars
- (37 933 étoiles)
- Métriques de merge PR
- (Merge moyen 16j 9h) (258 PRs mergées en 30 j)
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
the docs state
Generates an absolute URL if the protocol and host are non-null. See the remarks section for important security information.
but if you omit passing values or pass null it still generates an absolute URL, seeming based on the host header a request scheme of the request from http context https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs#L575
Expected Behavior
expect docs to not indicate absolute url requires thsoe params to be not null, should mention where it gets those values from if they are omitted or passed as null
Steps To Reproduce
n/a
Exceptions (if any)
n/a
.NET Version
6
Anything else?
No response