Comments (2)
Same problem here: nil
is not a valid return value, it triggers an NPE:
java.lang.NullPointerException: Ring handler returned nil
from ring-cors.
I think the correct behavior, instead of returning nil
should be to return the original result of the handler (without adding CORS headers).
This way it would trigger the CORS error on the browser and improve feedback.
On a project I'm working on, it returned nil thus triggering a 404 without any other hint, it took me some time to figure out it was due to an issue with this middleware.
from ring-cors.
Related Issues (19)
- access-control-allow-origin does not show in response headers HOT 4
- ring-cors breaks 404 routes when origin header is specified HOT 4
- Support for Access-Control-Allow-Credentials header HOT 2
- Only Trigger the middleware on Origin/Host mismatch HOT 1
- Remove dependency on ring-core HOT 1
- "Unable to resolve join in this context" HOT 1
- I've done the work to make this compatible with ring async, PR? HOT 2
- Cors headers not returned when invalid input
- `access-control-request-method` forbidden header
- Documentation is non-existant; can't get this to work.
- Possible to use middelware only on specific route? HOT 7
- Stack dump with {org.clojure/clojure {:mvn/version "1.10.1"} HOT 1
- Set Access-Control-Allow-Credentials HOT 1
- how to add wasm(WebAssembly)and etc content-type?
- `Access-Control-Allow-Methods` not always set correctly
- Switched to 0.1.2 from 0.1.1, my app broke... HOT 1
- ring-cors returns response with only normalized headers when handler returns nil and origin header is present HOT 2
- access-control-allow-origin * HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ring-cors.