wrap-resource causes 500 on match
See original GitHub issueDescribe the bug
When using wrap-resource
, 500 exceptions are raised for resources.
To Reproduce
;; src/foo.clj
(defonce server
(doto
(create-server
(create-donkey)
{:port 8080
:routes [{:handler-mode :blocking
:methods [:get]
:handler (fn [_]
{:status 200
:body "did not match a resource"})
:middleware [#(ring.middleware.resource/wrap-resource % "static")]
}]
:date-header true})
start-sync))
;; src/static/foo.txt
matched!
When hitting http://localhost:8080/foo.txt there will be a 500 error, that never terminates in the browser. curl -v
is the best way to see.
Expected behavior foo.txt is served
Desktop (please complete the following information): skipping, because not relevant?
Smartphone (please complete the following information): skipping, because not relevant?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
PM23578: ERROR 500 RESPONSE FROM PROXY SERVER ...
A 500 error occurs because the If-None-Match request header value is not being sent with double quotes by the client browser.
Read more >500 Internal Server Error - HTTP - MDN Web Docs - Mozilla
This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to response.
Read more >500 Internal Server Error - Backend Server | Apigee Edge
The 500 Internal Server Error responded by the backend server can be caused by a number of reasons. You will need to diagnose...
Read more >An HTTP 500 was Returned to ISA Because the Certificate on ...
An HTTP 500 was returned to ISA because the certificate on the published server doesn't match the name in the publishing rule.
Read more >Exception raise: {%extends "base.html"%} not found, causing ...
Welcome to Stack Overflow. HTTP 500 is a generic server-side error message. On its own it doesn't tell us anything useful. Any time...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For static resources we could add an option when creating a server -
:resources [map[, map]*]
which will be the same as the:routes
vector, except the map will include only a subset of the fields the route map accepts:Any thoughts?
@SevereOverfl0w - this issue is handled in PR #20 if you want to test it out. Though I still need to add documentation.