|
163 | 163 | (is (= 200 (:status resp))) |
164 | 164 | (is (= :get (:request-method (:req resp)))) |
165 | 165 | (is (= :http (:scheme (:req resp)))) |
166 | | - (is (= ["http://example.com" "http://example.net/bat"] (:trace-redirects resp))) |
| 166 | + (is (= ["http://example.com" "http://example.net/bat"] |
| 167 | + (:trace-redirects resp))) |
167 | 168 | (is (= "/bat" (:uri (:req resp)))))) |
168 | 169 |
|
169 | 170 | (deftest redirect-on-get-async |
|
181 | 182 | (is (= 200 (:status @resp))) |
182 | 183 | (is (= :get (:request-method (:req @resp)))) |
183 | 184 | (is (= :http (:scheme (:req @resp)))) |
184 | | - (is (= ["http://example.com" "http://example.net/bat"] (:trace-redirects @resp))) |
| 185 | + (is (= ["http://example.com" "http://example.net/bat"] |
| 186 | + (:trace-redirects @resp))) |
185 | 187 | (is (= "/bat" (:uri (:req @resp)))) |
186 | 188 | (is (not (realized? exception))))) |
187 | 189 |
|
|
198 | 200 | (is (= 200 (:status resp))) |
199 | 201 | (is (= :get (:request-method (:req resp)))) |
200 | 202 | (is (= :http (:scheme (:req resp)))) |
201 | | - (is (= ["http://example.com" "http://example.com/bat"] (:trace-redirects resp))) |
| 203 | + (is (= ["http://example.com" "http://example.com/bat"] |
| 204 | + (:trace-redirects resp))) |
202 | 205 | (is (= "/bat" (:uri (:req resp)))))) |
203 | 206 |
|
204 | 207 | (deftest relative-redirect-on-get-async |
|
216 | 219 | (is (= 200 (:status @resp))) |
217 | 220 | (is (= :get (:request-method (:req @resp)))) |
218 | 221 | (is (= :http (:scheme (:req @resp)))) |
219 | | - (is (= ["http://example.com" "http://example.com/bat"] (:trace-redirects @resp))) |
| 222 | + (is (= ["http://example.com" "http://example.com/bat"] |
| 223 | + (:trace-redirects @resp))) |
220 | 224 | (is (= "/bat" (:uri (:req @resp)))) |
221 | 225 | (is (not (realized? exception))))) |
222 | 226 |
|
|
279 | 283 | (is (= 200 (:status resp))) |
280 | 284 | (is (= :get (:request-method (:req resp)))) |
281 | 285 | (is (= :http (:scheme (:req resp)))) |
282 | | - (is (= ["http://example.com" "http://example.net/bat?x=y"] (:trace-redirects resp))) |
| 286 | + (is (= ["http://example.com" "http://example.net/bat?x=y"] |
| 287 | + (:trace-redirects resp))) |
283 | 288 | (is (= "/bat" (:uri (:req resp)))) |
284 | 289 | (is (= "x=y" (:query-string (:req resp)))) |
285 | 290 | (is (nil? (:query-params (:req resp)))))) |
|
353 | 358 | (is (= 200 (:status resp))) |
354 | 359 | (is (= :get (:request-method (:req resp)))) |
355 | 360 | (is (= :http (:scheme (:req resp)))) |
356 | | - (is (= ["http://example.com" "http://example.net/bat"] (:trace-redirects resp))) |
| 361 | + (is (= ["http://example.com" "http://example.net/bat"] |
| 362 | + (:trace-redirects resp))) |
357 | 363 | (is (= "/bat" (:uri (:req resp))))))) |
358 | 364 |
|
359 | 365 | (deftest redirect-303-to-get-on-any-method-async |
|
373 | 379 | (is (= 200 (:status @resp))) |
374 | 380 | (is (= :get (:request-method (:req @resp)))) |
375 | 381 | (is (= :http (:scheme (:req @resp)))) |
376 | | - (is (= ["http://example.com" "http://example.net/bat"] (:trace-redirects @resp))) |
| 382 | + (is (= ["http://example.com" "http://example.net/bat"] |
| 383 | + (:trace-redirects @resp))) |
377 | 384 | (is (= "/bat" (:uri (:req @resp)))) |
378 | 385 | (is (not (realized? exception)))))) |
379 | 386 |
|
|
441 | 448 | :request-method method |
442 | 449 | :force-redirects true})] |
443 | 450 | (is (= 200 (:status resp))) |
444 | | - (is (= ["http://example.com" "http://example.com/bat"] (:trace-redirects resp))) |
| 451 | + (is (= ["http://example.com" "http://example.com/bat"] |
| 452 | + (:trace-redirects resp))) |
445 | 453 | (is (= "ok" (:body resp))) |
446 | 454 | (is (= expected-method (:request-method (:req resp))))))) |
447 | 455 |
|
|
454 | 462 | :trace-redirects trace-redirects |
455 | 463 | :req req} |
456 | 464 | {:status status :body body :req req |
457 | | - :headers {"location" "http://example.com/bat"}}))) |
| 465 | + :headers {"location" |
| 466 | + "http://example.com/bat"}}))) |
458 | 467 | r-client (client/wrap-redirects client) |
459 | 468 | resp (promise) |
460 | 469 | exception (promise) |
461 | 470 | _ (r-client {:body "ok" :url "http://example.com" |
462 | 471 | :request-method method |
463 | 472 | :force-redirects true} resp exception)] |
464 | 473 | (is (= 200 (:status @resp))) |
465 | | - (is (= ["http://example.com" "http://example.com/bat"] (:trace-redirects @resp))) |
| 474 | + (is (= ["http://example.com" "http://example.com/bat"] |
| 475 | + (:trace-redirects @resp))) |
466 | 476 | (is (= "ok" (:body @resp))) |
467 | 477 | (is (= expected-method (:request-method (:req @resp)))) |
468 | 478 | (is (not (realized? exception)))))) |
|
0 commit comments