mirror of
https://github.com/metosin/reitit.git
synced 2026-02-19 09:15:54 +00:00
Add a failing test
This commit is contained in:
parent
3381fe34e5
commit
4933927fa9
1 changed files with 18 additions and 1 deletions
|
|
@ -3,7 +3,8 @@
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[reitit.middleware :as middleware]
|
[reitit.middleware :as middleware]
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
[reitit.core :as r])
|
[reitit.core :as r]
|
||||||
|
[reitit.trie :as trie])
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(:import (clojure.lang ExceptionInfo))))
|
(:import (clojure.lang ExceptionInfo))))
|
||||||
|
|
||||||
|
|
@ -577,3 +578,19 @@
|
||||||
(fn [{:keys [::r/router]} _ _]
|
(fn [{:keys [::r/router]} _ _]
|
||||||
(is router)))
|
(is router)))
|
||||||
{} ::respond ::raise)))
|
{} ::respond ::raise)))
|
||||||
|
|
||||||
|
#?(:clj
|
||||||
|
(deftest invalid-path-parameters-parsing-concurrent-requests-277-test
|
||||||
|
(testing "in enought concurrent system, path-parameters can bleed"
|
||||||
|
(doseq [compiler [trie/java-trie-compiler trie/clojure-trie-compiler]]
|
||||||
|
(let [app (ring/ring-handler
|
||||||
|
(ring/router
|
||||||
|
["/:id" (fn [request]
|
||||||
|
{:status 200
|
||||||
|
:body (-> request :path-params :id)})])
|
||||||
|
{::trie/trie-compiler compiler})]
|
||||||
|
(dotimes [_ 10]
|
||||||
|
(future
|
||||||
|
(dotimes [n 100000]
|
||||||
|
(let [body (:body (app {:request-method :get, :uri (str "/" n)}))]
|
||||||
|
(is (= body (str n))))))))))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue