File tree 2 files changed +11
-6
lines changed
src/Microsoft.AspNetCore.Routing 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ private VirtualPathData NormalizeVirtualPath(VirtualPathData pathData)
139
139
140
140
var url = pathData . VirtualPath ;
141
141
142
- if ( ! string . IsNullOrEmpty ( url ) && ( _options . LowercaseUrls || _options . AppendTrailingSlash ) )
142
+ if ( ! string . IsNullOrEmpty ( url ) && ( _options . LowercaseUrls || _options . LowercaseQueryStrings || _options . AppendTrailingSlash ) )
143
143
{
144
144
var indexOfSeparator = url . IndexOfAny ( UrlQueryDelimiters ) ;
145
145
var urlWithoutQueryString = url ;
@@ -154,11 +154,11 @@ private VirtualPathData NormalizeVirtualPath(VirtualPathData pathData)
154
154
if ( _options . LowercaseUrls )
155
155
{
156
156
urlWithoutQueryString = urlWithoutQueryString . ToLowerInvariant ( ) ;
157
+ }
157
158
158
- if ( ! string . IsNullOrEmpty ( queryString ) )
159
- {
160
- queryString = queryString . ToLowerInvariant ( ) ;
161
- }
159
+ if ( _options . LowercaseQueryStrings )
160
+ {
161
+ queryString = queryString . ToLowerInvariant ( ) ;
162
162
}
163
163
164
164
if ( _options . AppendTrailingSlash && ! urlWithoutQueryString . EndsWith ( "/" ) )
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ namespace Microsoft.AspNetCore.Routing
10
10
public class RouteOptions
11
11
{
12
12
/// <summary>
13
- /// Gets or sets a value indicating whether all generated URLs are lower-case.
13
+ /// Gets or sets a value indicating whether all generated URLs are lower-case. it doesn't include the query string.
14
14
/// </summary>
15
15
public bool LowercaseUrls { get ; set ; }
16
16
17
+ /// <summary>
18
+ /// Gets or sets a value indicating whether all generated QUERY STRINGS are lower-case.
19
+ /// </summary>
20
+ public bool LowercaseQueryStrings { get ; set ; }
21
+
17
22
/// <summary>
18
23
/// Gets or sets a value indicating whether a trailing slash should be appended to the generated URLs.
19
24
/// </summary>
You can’t perform that action at this time.
0 commit comments