Skip to content

Commit d4ef24a

Browse files
authored
Merge pull request #836 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2 parents 3863601 + af47b27 commit d4ef24a

File tree

4 files changed

+84
-4
lines changed

4 files changed

+84
-4
lines changed

src/Microsoft.AspNetCore.Routing.Abstractions/LinkGenerationTemplate.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public abstract string GetPath(
6363
/// </param>
6464
/// <param name="host">
6565
/// The URI host/authority, applied to the resulting URI. Optional. If not provided, the value <see cref="HttpRequest.Host"/> will be used.
66+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
6667
/// </param>
6768
/// <param name="pathBase">
6869
/// An optional URI path base. Prepended to the path in the resulting URI. If not provided, the value of <see cref="HttpRequest.PathBase"/> will be used.
@@ -73,6 +74,14 @@ public abstract string GetPath(
7374
/// names from <c>RouteOptions</c>.
7475
/// </param>
7576
/// <returns>A URI with an absolute path, or <c>null</c>.</returns>
77+
/// <remarks>
78+
/// <para>
79+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
80+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
81+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
82+
/// your deployment environment.
83+
/// </para>
84+
/// </remarks>
7685
public abstract string GetUri(
7786
HttpContext httpContext,
7887
object values,
@@ -87,14 +96,25 @@ public abstract string GetUri(
8796
/// </summary>
8897
/// <param name="values">The route values. Used to expand parameters in the route template. Optional.</param>
8998
/// <param name="scheme">The URI scheme, applied to the resulting URI.</param>
90-
/// <param name="host">The URI host/authority, applied to the resulting URI.</param>
99+
/// <param name="host">
100+
/// The URI host/authority, applied to the resulting URI.
101+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
102+
/// </param>
91103
/// <param name="pathBase">An optional URI path base. Prepended to the path in the resulting URI.</param>
92104
/// <param name="fragment">An optional URI fragment. Appended to the resulting URI.</param>
93105
/// <param name="options">
94106
/// An optional <see cref="LinkOptions"/>. Settings on provided object override the settings with matching
95107
/// names from <c>RouteOptions</c>.
96108
/// </param>
97109
/// <returns>An absolute URI, or <c>null</c>.</returns>
110+
/// <remarks>
111+
/// <para>
112+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
113+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
114+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
115+
/// your deployment environment.
116+
/// </para>
117+
/// </remarks>
98118
public abstract string GetUri(
99119
object values,
100120
string scheme,

src/Microsoft.AspNetCore.Routing.Abstractions/LinkGenerator.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public abstract string GetPathByAddress<TAddress>(
8383
/// </param>
8484
/// <param name="host">
8585
/// The URI host/authority, applied to the resulting URI. Optional. If not provided, the value <see cref="HttpRequest.Host"/> will be used.
86+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
8687
/// </param>
8788
/// <param name="pathBase">
8889
/// An optional URI path base. Prepended to the path in the resulting URI. If not provided, the value of <see cref="HttpRequest.PathBase"/> will be used.
@@ -93,6 +94,14 @@ public abstract string GetPathByAddress<TAddress>(
9394
/// names from <c>RouteOptions</c>.
9495
/// </param>
9596
/// <returns>A URI with an absolute path, or <c>null</c>.</returns>
97+
/// <remarks>
98+
/// <para>
99+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
100+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
101+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
102+
/// your deployment environment.
103+
/// </para>
104+
/// </remarks>
96105
public abstract string GetUriByAddress<TAddress>(
97106
HttpContext httpContext,
98107
TAddress address,
@@ -111,14 +120,25 @@ public abstract string GetUriByAddress<TAddress>(
111120
/// <param name="address">The address value. Used to resolve endpoints.</param>
112121
/// <param name="values">The route values. Used to expand parameters in the route template. Optional.</param>
113122
/// <param name="scheme">The URI scheme, applied to the resulting URI.</param>
114-
/// <param name="host">The URI host/authority, applied to the resulting URI.</param>
123+
/// <param name="host">
124+
/// The URI host/authority, applied to the resulting URI.
125+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
126+
/// </param>
115127
/// <param name="pathBase">An optional URI path base. Prepended to the path in the resulting URI.</param>
116128
/// <param name="fragment">An optional URI fragment. Appended to the resulting URI.</param>
117129
/// <param name="options">
118130
/// An optional <see cref="LinkOptions"/>. Settings on provided object override the settings with matching
119131
/// names from <c>RouteOptions</c>.
120132
/// </param>
121133
/// <returns>An absolute URI, or <c>null</c>.</returns>
134+
/// <remarks>
135+
/// <para>
136+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
137+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
138+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
139+
/// your deployment environment.
140+
/// </para>
141+
/// </remarks>
122142
public abstract string GetUriByAddress<TAddress>(
123143
TAddress address,
124144
RouteValueDictionary values,

src/Microsoft.AspNetCore.Routing/LinkGeneratorEndpointNameAddressExtensions.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public static string GetPathByName(
112112
/// </param>
113113
/// <param name="host">
114114
/// The URI host/authority, applied to the resulting URI. Optional. If not provided, the value <see cref="HttpRequest.Host"/> will be used.
115+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
115116
/// </param>
116117
/// <param name="pathBase">
117118
/// An optional URI path base. Prepended to the path in the resulting URI. If not provided, the value of <see cref="HttpRequest.PathBase"/> will be used.
@@ -122,6 +123,14 @@ public static string GetPathByName(
122123
/// names from <c>RouteOptions</c>.
123124
/// </param>
124125
/// <returns>A URI with an absolute path, or <c>null</c>.</returns>
126+
/// <remarks>
127+
/// <para>
128+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
129+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
130+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
131+
/// your deployment environment.
132+
/// </para>
133+
/// </remarks>
125134
public static string GetUriByName(
126135
this LinkGenerator generator,
127136
HttpContext httpContext,
@@ -167,14 +176,25 @@ public static string GetUriByName(
167176
/// <param name="endpointName">The endpoint name. Used to resolve endpoints.</param>
168177
/// <param name="values">The route values. Used to expand parameters in the route template. Optional.</param>
169178
/// <param name="scheme">The URI scheme, applied to the resulting URI.</param>
170-
/// <param name="host">The URI host/authority, applied to the resulting URI.</param>
179+
/// <param name="host">
180+
/// The URI host/authority, applied to the resulting URI.
181+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
182+
/// </param>
171183
/// <param name="pathBase">An optional URI path base. Prepended to the path in the resulting URI.</param>
172184
/// <param name="fragment">An optional URI fragment. Appended to the resulting URI.</param>
173185
/// <param name="options">
174186
/// An optional <see cref="LinkOptions"/>. Settings on provided object override the settings with matching
175187
/// names from <c>RouteOptions</c>.
176188
/// </param>
177189
/// <returns>An absolute URI, or <c>null</c>.</returns>
190+
/// <remarks>
191+
/// <para>
192+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
193+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
194+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
195+
/// your deployment environment.
196+
/// </para>
197+
/// </remarks>
178198
public static string GetUriByName(
179199
this LinkGenerator generator,
180200
string endpointName,

src/Microsoft.AspNetCore.Routing/LinkGeneratorRouteValuesAddressExtensions.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public static string GetPathByRouteValues(
104104
/// </param>
105105
/// <param name="host">
106106
/// The URI host/authority, applied to the resulting URI. Optional. If not provided, the value <see cref="HttpRequest.Host"/> will be used.
107+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
107108
/// </param>
108109
/// <param name="pathBase">
109110
/// An optional URI path base. Prepended to the path in the resulting URI. If not provided, the value of <see cref="HttpRequest.PathBase"/> will be used.
@@ -114,6 +115,14 @@ public static string GetPathByRouteValues(
114115
/// names from <c>RouteOptions</c>.
115116
/// </param>
116117
/// <returns>A URI with an absolute path, or <c>null</c>.</returns>
118+
/// <remarks>
119+
/// <para>
120+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
121+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
122+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
123+
/// your deployment environment.
124+
/// </para>
125+
/// </remarks>
117126
public static string GetUriByRouteValues(
118127
this LinkGenerator generator,
119128
HttpContext httpContext,
@@ -155,14 +164,25 @@ public static string GetUriByRouteValues(
155164
/// <param name="routeName">The route name. Used to resolve endpoints. Optional.</param>
156165
/// <param name="values">The route values. Used to resolve endpoints and expand parameters in the route template. Optional.</param>
157166
/// <param name="scheme">The URI scheme, applied to the resulting URI.</param>
158-
/// <param name="host">The URI host/authority, applied to the resulting URI.</param>
167+
/// <param name="host">
168+
/// The URI host/authority, applied to the resulting URI.
169+
/// See the remarks section for details about the security implications of the <paramref name="host"/>.
170+
/// </param>
159171
/// <param name="pathBase">An optional URI path base. Prepended to the path in the resulting URI.</param>
160172
/// <param name="fragment">An optional URI fragment. Appended to the resulting URI.</param>
161173
/// <param name="options">
162174
/// An optional <see cref="LinkOptions"/>. Settings on provided object override the settings with matching
163175
/// names from <c>RouteOptions</c>.
164176
/// </param>
165177
/// <returns>An absolute URI, or <c>null</c>.</returns>
178+
/// <remarks>
179+
/// <para>
180+
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
181+
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
182+
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
183+
/// your deployment environment.
184+
/// </para>
185+
/// </remarks>
166186
public static string GetUriByRouteValues(
167187
this LinkGenerator generator,
168188
string routeName,

0 commit comments

Comments
 (0)