- Use async version from rocket's master branch by @HenningHolmDE in lawliet89#81
- fix: Update to latest master Rocket version by @DusterTheFirst in lawliet89#85
- Update to latest master Rocket version by @thanadolps in lawliet89#89
- Upgrade to GitHub-native Dependabot by @dependabot-preview in lawliet89#90
- Update to latest Rocket master by @ELD in lawliet89#91
- Resolve Tokio Dependency conflicy by @magpie-engineering in lawliet89#92
- Update to Rocket 0.5-rc.1 by @ELD in lawliet89#93
- Update lib.rs and README for nightly req and version by @jtroo in lawliet89#95
- Responder lifetime cannot be infered by @mrene in lawliet89#97
- Fix documentation typos by @deneiruy in lawliet89#98
- Fix rustdoc lint drift by @ELD in lawliet89#101
- Drop body from response to preflight request by @KOBA789 in lawliet89#100
- docs: fix ci badge by @torkleyy in lawliet89#104
- feat: update rust edition from 2018 to 2021 by @somehowchris in lawliet89#105
- @HenningHolmDE made their first contribution in lawliet89#81
- @DusterTheFirst made their first contribution in lawliet89#85
- @thanadolps made their first contribution in lawliet89#89
- @magpie-engineering made their first contribution in lawliet89#92
- @jtroo made their first contribution in lawliet89#95
- @mrene made their first contribution in lawliet89#97
- @deneiruy made their first contribution in lawliet89#98
- @KOBA789 made their first contribution in lawliet89#100
- @torkleyy made their first contribution in lawliet89#104
- @somehowchris made their first contribution in lawliet89#105
Full Changelog: https://github.com/lawliet89/rocket_cors/compare/v0.5.2...v0.6.0-alpha1
- 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(()) }