diff --git a/ring-core/project.clj b/ring-core/project.clj index d2fffb6c..8a8a7fe8 100644 --- a/ring-core/project.clj +++ b/ring-core/project.clj @@ -1,4 +1,4 @@ -(defproject ring/ring-core "1.12.2" +(defproject ring/ring-core "1.12.2-patched-graal" :description "Ring core libraries." :url "https://github.com/ring-clojure/ring" :scm {:dir ".."} diff --git a/ring-core/src/ring/util/response.clj b/ring-core/src/ring/util/response.clj index a638f7a2..a3bdfdb7 100644 --- a/ring-core/src/ring/util/response.clj +++ b/ring-core/src/ring/util/response.clj @@ -297,6 +297,14 @@ :content-length (connection-content-length conn) :last-modified (connection-last-modified conn)}))) +(defmethod resource-data :resource + [^java.net.URL url] + ;; GraalVM resource scheme + (let [resource (.openConnection url)] + {:content (.getInputStream resource) + :content-length (connection-content-length resource) + :last-modified (connection-last-modified resource)})) + (defn url-response "Return a response for the supplied URL." {:added "1.2"}