2017-07-13 08:08:14 +00:00
|
|
|
# rocket_cors
|
|
|
|
|
|
|
|
[![Build Status](https://travis-ci.org/lawliet89/rocket_cors.svg)](https://travis-ci.org/lawliet89/rocket_cors)
|
|
|
|
[![Dependency Status](https://dependencyci.com/github/lawliet89/rocket_cors/badge)](https://dependencyci.com/github/lawliet89/rocket_cors)
|
|
|
|
[![Repository](https://img.shields.io/github/tag/lawliet89/rocket_cors.svg)](https://github.com/lawliet89/rocket_cors)
|
2017-07-18 10:22:20 +00:00
|
|
|
[![Crates.io](https://img.shields.io/crates/v/rocket_cors.svg)](https://crates.io/crates/rocket_cors)
|
2017-07-13 08:08:14 +00:00
|
|
|
|
2018-02-14 08:39:12 +00:00
|
|
|
- Documentation: [master branch](https://lawliet89.github.io/rocket_cors) | [stable](https://lawliet89.github.io/docs/rocket_cors/0.2.3/rocket_cors)
|
2017-07-13 08:08:14 +00:00
|
|
|
|
|
|
|
Cross-origin resource sharing (CORS) for [Rocket](https://rocket.rs/) applications
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- Nightly Rust
|
2017-07-15 02:37:10 +00:00
|
|
|
- Rocket >= 0.3
|
2017-07-13 08:08:14 +00:00
|
|
|
|
|
|
|
### Nightly Rust
|
|
|
|
|
2017-07-15 02:37:10 +00:00
|
|
|
Rocket requires nightly Rust. You should probably install Rust with
|
|
|
|
[rustup](https://www.rustup.rs/), then override the code directory to use nightly instead of stable.
|
|
|
|
See
|
2017-07-13 08:08:14 +00:00
|
|
|
[installation instructions](https://rocket.rs/guide/getting-started/#installing-rust).
|
|
|
|
|
2018-02-14 05:20:31 +00:00
|
|
|
In particular, `rocket_cors` is currently targetted for the latest `nightly`. Older nightlies might
|
|
|
|
work, but they are subject to the minimum that Rocket sets.
|
2017-07-13 08:08:14 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2017-07-18 10:22:20 +00:00
|
|
|
Add the following to Cargo.toml:
|
2017-07-13 08:08:14 +00:00
|
|
|
|
|
|
|
```toml
|
2018-02-14 07:19:51 +00:00
|
|
|
rocket_cors = "0.3.0"
|
2017-07-18 10:22:20 +00:00
|
|
|
```
|
2017-07-13 08:08:14 +00:00
|
|
|
|
|
|
|
To use the latest `master` branch, for example:
|
|
|
|
|
|
|
|
```toml
|
2017-07-14 03:03:45 +00:00
|
|
|
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
|
2017-07-13 08:08:14 +00:00
|
|
|
```
|
2017-07-14 03:03:45 +00:00
|
|
|
|
|
|
|
## Reference
|
|
|
|
|
|
|
|
- [W3C CORS Recommendation](https://www.w3.org/TR/cors/#resource-processing-model)
|