Commits

Ian Eure  committed a9c4232

Handle requests which either:
- Prefix match a normalized `uri`
- Exactly match the raw `uri`.

  • Participants
  • Parent commits 6d32adf

Comments (0)

Files changed (1)

File metrics-clojure-ring/src/metrics/ring/expose.clj

 (defn expose-metrics-as-json
   ([handler] (expose-metrics-as-json handler "/metrics"))
   ([handler uri]
-   (let [uri (sanitize-uri uri)]
+   (let [request-uri (:uri request)]
      (fn [request]
-       (if (.startsWith (:uri request) uri)
+       (if (or (.startsWith request-uri (sanitize-uri uri))
+               (= request-uri uri))
          (metrics-json request)
          (handler request))))))