Skip to content

Commit

Permalink
Merge pull request #1 from Stylitics/patch-ring-to-support-graal
Browse files Browse the repository at this point in the history
patch ring to support graal
  • Loading branch information
zlrth authored Jul 7, 2024
2 parents f92911c + b873e42 commit 68bf105
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ring-core/project.clj
Original file line number Diff line number Diff line change
@@ -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 ".."}
Expand Down
8 changes: 8 additions & 0 deletions ring-core/src/ring/util/response.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit 68bf105

Please sign in to comment.