Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch ring to support graal #508

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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