File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -10,20 +10,22 @@ internal static class GetRequest
1010
1111 internal static bool IsGet ( this HttpRequest request )
1212 {
13- return request . Method . Equals ( _getMethod , StringComparison . OrdinalIgnoreCase ) ;
13+ return request . Method . Equals ( _getMethod , StringComparison . OrdinalIgnoreCase )
14+ && HasQueryParameter ( request . HttpContext ) ;
1415 }
1516
1617 internal static QueryRequest ReadRequest ( HttpContext context )
1718 {
18- string query = string . Empty ;
19-
20- if ( context . Request . QueryString . HasValue &&
21- context . Request . Query . ContainsKey ( _queryIdentifier ) )
19+ return new QueryRequest ( )
2220 {
23- query = context . Request . Query [ _queryIdentifier ] . ToString ( ) ;
24- }
21+ Query = context . Request . Query [ _queryIdentifier ] . ToString ( )
22+ } ;
23+ }
2524
26- return new QueryRequest ( ) { Query = query } ;
25+ private static bool HasQueryParameter ( HttpContext context )
26+ {
27+ return context . Request . QueryString . HasValue &&
28+ context . Request . Query . ContainsKey ( _queryIdentifier ) ;
2729 }
2830 }
2931}
You can’t perform that action at this time.
0 commit comments