File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1770,6 +1770,9 @@ Task<string> FetchSomeStuffWithHardcodedAndOtherQueryParameters(
17701770 [ Get ( "/foo/bar?param=first {id} and second {id}" ) ]
17711771 Task < string > FetchSomeStuffWithTheIdInAParameterMultipleTimes ( int id ) ;
17721772
1773+ [ Get ( "/foo?q=app_metadata.id:\" {id}\" " ) ]
1774+ Task < string > FetchSomeStuffWithDoubleQuotesInUrl ( int id ) ;
1775+
17731776 [ Post ( "/foo/bar/{id}" ) ]
17741777 [ Headers ( "Content-Type: literally/anything" ) ]
17751778 Task < string > PostSomeStuffWithHardCodedContentTypeHeader ( int id , [ Body ] string content ) ;
@@ -2594,6 +2597,20 @@ public void QueryParamWithPathDelimiterShouldBeEncoded()
25942597 ) ;
25952598 }
25962599
2600+ [ Fact ]
2601+ public void QueryParamWhichEndsInDoubleQuotesShouldNotBeTruncated ( )
2602+ {
2603+ var fixture = new RequestBuilderImplementation < IDummyHttpApi > ( ) ;
2604+ var factory = fixture . BuildRequestFactoryForMethod (
2605+ "FetchSomeStuffWithDoubleQuotesInUrl"
2606+ ) ;
2607+ var output = factory ( new object [ ] { 42 } ) ;
2608+
2609+ var uri = new Uri ( new Uri ( "http://api" ) , output . RequestUri ) ;
2610+
2611+ Assert . Equal ( "/foo?q=app_metadata.id%3A%2242%22" , uri . PathAndQuery ) ;
2612+ }
2613+
25972614 [ Fact ]
25982615 public void ParameterizedQueryParamsShouldBeInUrlAndValuesEncodedWhenMixedReplacementAndQueryBadId ( )
25992616 {
Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ ParameterInfo[] parameterInfo
402402 }
403403
404404 // add trailing string
405- if ( index < relativePath . Length - 1 )
405+ if ( index < relativePath . Length )
406406 {
407407 var trailingConstant = relativePath . Substring ( index , relativePath . Length - index ) ;
408408 fragmentList . Add ( ParameterFragment . Constant ( trailingConstant ) ) ;
You can’t perform that action at this time.
0 commit comments