- Update to latest master Rocket version (#89) by @j03-dev in #114
- @j03-dev made their first contribution in #114
Full Changelog: https://github.com/lawliet89/rocket_cors/compare/v0.6.0-alpha2...v0.6.0-alpha3
- Use async version from rocket's master branch by @HenningHolmDE in #81
- fix: Update to latest master Rocket version by @DusterTheFirst in #85
- Update to latest master Rocket version by @thanadolps in #89
- Upgrade to GitHub-native Dependabot by @dependabot-preview in #90
- Update to latest Rocket master by @ELD in #91
- Resolve Tokio Dependency conflicy by @magpie-engineering in #92
- Update to Rocket 0.5-rc.1 by @ELD in #93
- Update lib.rs and README for nightly req and version by @jtroo in #95
- Responder lifetime cannot be infered by @mrene in #97
- Fix documentation typos by @deneiruy in #98
- Fix rustdoc lint drift by @ELD in #101
- Drop body from response to preflight request by @KOBA789 in #100
- docs: fix ci badge by @torkleyy in #104
- feat: update rust edition from 2018 to 2021 by @somehowchris in #105
- @HenningHolmDE made their first contribution in #81
- @DusterTheFirst made their first contribution in #85
- @thanadolps made their first contribution in #89
- @magpie-engineering made their first contribution in #92
- @jtroo made their first contribution in #95
- @mrene made their first contribution in #97
- @deneiruy made their first contribution in #98
- @KOBA789 made their first contribution in #100
- @torkleyy made their first contribution in #104
- @somehowchris made their first contribution in #105
Full Changelog: https://github.com/lawliet89/rocket_cors/compare/v0.5.2...v0.6.0-alpha2
- Add a builder methods for
CorsOptions
(#75)
There are no new features.
- Fix build issues with Rocket 0.4.2
- Fix clippy lints with latest nightly
There is no change since 0.5.0-beta1
.
- The
Cors
struct can no longer be constructed. Instead, you will now construct the options for Cors directly or through deserialization using theCorsOptions
struct. Then, you can constructCors
for use in Fairings or manual responses using theCorsOptions::to_cors
method. - The
AllowedOrigins
type has been modified. It is now a typedef ofAllOrSome<Origins>
whereOrigins
is now a struct supporting exact matches or regex matches.
-
Existing use of
AllowedOrigins::some
to create exact matches can be replaced simply withAllowedOrigins::some_exact
instead. -
Replace all construction of
Cors
struct withCorsOptions
instead. Then, you can create theCors
struct for use in Fairings using theCorsOptions::to_cors
method-fn main() { +fn main() -> Result<(), Error> { let (allowed_origins, failed_origins) = AllowedOrigins::some(&["https://www.acme.com"]); assert!(failed_origins.is_empty()); // You can also deserialize this - let options = rocket_cors::Cors { + let cors = rocket_cors::CorsOptions { allowed_origins: allowed_origins, allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(), allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]), allow_credentials: true, ..Default::default() - }; + } + .to_cors()?; rocket::ignite() .mount("/", routes![cors]) - .attach(options) + .attach(cors) .launch(); + + Ok(()) }