ring-clojure / ring-json

Ring middleware for handling JSON
313 stars 47 forks source link

Just one character to make regex a little bit faster #63

Open maxp opened 4 years ago

maxp commented 4 years ago

Non greedy regex could be relatively slow in some cases https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L13

just add one '?' after first +

#"^application/(.+?\+)?json"