|
471 | 471 |
|
472 | 472 | (testing "from root"
|
473 | 473 | (let [app (ring/ring-handler
|
474 |
| - (ring/router |
475 |
| - ["/*" (create nil)]) |
476 |
| - (ring/create-default-handler))] |
| 474 | + (ring/router |
| 475 | + ["/*" (create nil)]) |
| 476 | + (ring/create-default-handler))] |
477 | 477 | (testing "different file-types"
|
478 | 478 | (let [response (app (request "/hello.json"))]
|
479 | 479 | (is (= "application/json" (get-in response [:headers "Content-Type"])))
|
|
484 | 484 | (is (get-in response [:headers "Last-Modified"]))
|
485 | 485 | (is (= "<xml><hello>file</hello></xml>\n" (slurp (:body response))))))
|
486 | 486 |
|
| 487 | + (testing "with url decoding" |
| 488 | + (let [response (app (request "/with%20space.txt"))] |
| 489 | + (is (= 200 (:status response))) |
| 490 | + (is (= "hello\n" (slurp (:body response)))))) |
| 491 | + |
487 | 492 | (testing "index-files"
|
488 | 493 | (let [response (app (request "/docs"))]
|
489 | 494 | (is (= (redirect "/docs/index.html") response)))
|
|
520 | 525 | (is (get-in response [:headers "Last-Modified"]))
|
521 | 526 | (is (= "<xml><hello>file</hello></xml>\n" (slurp (:body response))))))
|
522 | 527 |
|
| 528 | + (testing "with url decoding" |
| 529 | + (let [response (app (request "/with%20space.txt"))] |
| 530 | + (is (= 200 (:status response))) |
| 531 | + (is (= "hello\n" (slurp (:body response)))))) |
| 532 | + |
523 | 533 | (testing "index-files"
|
524 | 534 | (let [response (app (request "/docs"))]
|
525 | 535 | (is (= (redirect "/docs/index.html") response)))
|
|
557 | 567 | (is (get-in response [:headers "Last-Modified"]))
|
558 | 568 | (is (= "<xml><hello>file</hello></xml>\n" (slurp (:body response))))))
|
559 | 569 |
|
| 570 | + (testing "with url decoding" |
| 571 | + (let [response (app (request "/with%20space.txt"))] |
| 572 | + (is (= 200 (:status response))) |
| 573 | + (is (= "hello\n" (slurp (:body response)))))) |
| 574 | + |
560 | 575 | (testing "index-files"
|
561 | 576 | (let [response (app (request "/docs"))]
|
562 | 577 | (is (= (redirect "/docs/index.html") response)))
|
|
595 | 610 | (is (get-in response [:headers "Last-Modified"]))
|
596 | 611 | (is (= "<xml><hello>file</hello></xml>\n" (slurp (:body response))))))
|
597 | 612 |
|
| 613 | + (testing "with url decoding" |
| 614 | + (let [response (app (request "/with%20space.txt"))] |
| 615 | + (is (= 200 (:status response))) |
| 616 | + (is (= "hello\n" (slurp (:body response)))))) |
| 617 | + |
598 | 618 | (testing "index-files"
|
599 | 619 | (let [response (app (request "/docs"))]
|
600 | 620 | (is (= (redirect "/docs/index.html") response)))
|
|
0 commit comments