@@ -123,6 +123,50 @@ public async Task CatchAllApis()
123
123
Assert . Equal ( "Pong" , content ) ;
124
124
}
125
125
126
+ [ Fact ]
127
+ public async Task TrailingSlashRemoved ( )
128
+ {
129
+ HttpRequestMessage req = new HttpRequestMessage ( HttpMethod . Get , $ "staticBackendUrlTest/blahblah/") ;
130
+ req . Headers . Add ( "return_incoming_url" , "1" ) ;
131
+ HttpResponseMessage response = await _fixture . HttpClient . SendAsync ( req ) ;
132
+ string content = await response . Content . ReadAsStringAsync ( ) ;
133
+ Assert . Equal ( "200" , response . StatusCode . ToString ( "D" ) ) ;
134
+ Assert . Equal ( @"http://localhost/api/myroute/mysubroute?a=1" , content ) ;
135
+ }
136
+
137
+ [ Fact ]
138
+ public async Task TrailingSlashRemoved2 ( )
139
+ {
140
+ HttpRequestMessage req = new HttpRequestMessage ( HttpMethod . Get , $ "simpleParamBackendUrlTest/myroute/mysubroute/") ;
141
+ req . Headers . Add ( "return_incoming_url" , "1" ) ;
142
+ HttpResponseMessage response = await _fixture . HttpClient . SendAsync ( req ) ;
143
+ string content = await response . Content . ReadAsStringAsync ( ) ;
144
+ Assert . Equal ( "200" , response . StatusCode . ToString ( "D" ) ) ;
145
+ Assert . Equal ( @"http://localhost/api/myroute/mysubroute?a=1" , content ) ;
146
+ }
147
+
148
+ [ Fact ]
149
+ public async Task TrailingSlashKept ( )
150
+ {
151
+ HttpRequestMessage req = new HttpRequestMessage ( HttpMethod . Get , $ "wildcardBackendUrlTest/myroute/mysubroute/") ;
152
+ req . Headers . Add ( "return_incoming_url" , "1" ) ;
153
+ HttpResponseMessage response = await _fixture . HttpClient . SendAsync ( req ) ;
154
+ string content = await response . Content . ReadAsStringAsync ( ) ;
155
+ Assert . Equal ( "200" , response . StatusCode . ToString ( "D" ) ) ;
156
+ Assert . Equal ( @"http://localhost/api/myroute%2Fmysubroute/?a=1" , content ) ;
157
+ }
158
+
159
+ [ Fact ]
160
+ public async Task TrailingSlashKept2 ( )
161
+ {
162
+ var req = new HttpRequestMessage ( HttpMethod . Get , $ "wildcardBackendUrlTest/myroute/mysubroute") ;
163
+ req . Headers . Add ( "return_incoming_url" , "1" ) ;
164
+ var response = await _fixture . HttpClient . SendAsync ( req ) ;
165
+ var content = await response . Content . ReadAsStringAsync ( ) ;
166
+ Assert . Equal ( "200" , response . StatusCode . ToString ( "D" ) ) ;
167
+ Assert . Equal ( @"http://localhost/api/myroute%2Fmysubroute?a=1" , content ) ;
168
+ }
169
+
126
170
[ Fact ]
127
171
public async Task CatchAllWithCustomRoutes ( )
128
172
{
0 commit comments