question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wrap-resource causes 500 on match

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yaronelcommented, Feb 15, 2021

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:

  • :path
  • :match-type
  • :methods
  • :consumes
  • :produces

Any thoughts?

0reactions
yaronelcommented, Feb 18, 2021

@SevereOverfl0w - this issue is handled in PR #20 if you want to test it out. Though I still need to add documentation.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found