https://github.com/mikesir87/javacors
CORS support for Java and various frameworks
https://github.com/mikesir87/javacors
Last synced: about 2 months ago
JSON representation
CORS support for Java and various frameworks
- Host: GitHub
- URL: https://github.com/mikesir87/javacors
- Owner: mikesir87
- License: other
- Created: 2017-03-28T19:57:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T08:39:22.000Z (about 2 years ago)
- Last Synced: 2025-04-01T15:54:16.950Z (about 2 months ago)
- Language: Java
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JavaCors
[](https://travis-ci.org/mikesir87/javacors)
This project provides CORS support and integrates it into various Java frameworks.
## Why this project?
Few reasons...
- In some cases, the desire to use a servlet filter-based approach may not be available. For example, consider an endpoint that requires authentication and is using servlet/container-based authentication. App-provided filters don't have the ability to add CORS headers if the user isn't authenticated (which is always the case for pre-flight checks).
- While the spec isn't _too_ complicated, it's more than just simply adding headers, as most examples show. And honestly, most of the examples are terribly insecure (do you really want to allow all origins or allow credentials by default?).## Modules
This project contains a few submodules that allow you to pick and choose what you need.
- **`javacors-runtime`** - provides the API and runtime for CORS processing. The default implementation validates a request and then adds all the necessary/configured headers.
- **`javacors-undertow`** - provides a `HttpHandler` that can be plugged into Undertow to add CORS support
- **`javacors-wildfly`** - provides a module installation (simply wrapping the `javacors-undertow` module) that can be dropped in and configured to run in Wildfly## Contributing
All are welcome to contribute! If you notice a bug, an issue, or want to add another framework integration, feel free to open an issue or submit a PR!