corsware

Crates.iocorsware
lib.rscorsware
version0.2.0
sourcesrc
created_at2017-05-20 08:37:06.265908
updated_at2017-11-25 17:54:59.383228
descriptionCORS for Iron According to the Spec
homepagehttps://github.com/atorstling/corsware
repository
max_upload_size
id15310
size54,049
Alexander Torstling (atorstling)

documentation

https://atorstling.github.io/corsware/corsware/index.html

README

Corsware

Corsware is yet another implementation of the CORS Specification for Iron. The ambition of this implementation is to make a more or less complete implementation following the spec as closely as possible. This means supporting preflight request detection, normal request decoration, allowing credentials, origins, methods and headers, exposing headers, handling null Origins and setting Max-Age.

The middleware itself is simply a standard Iron AroundMiddleware and contains no special routing logic.

Simple Example

extern crate iron;
extern crate corsware;
use corsware::CorsMiddleware;
use iron::prelude::*;
use iron::status;

fn main() {
  let handler = |_: &mut Request| {
      Ok(Response::with((status::Ok, "Hello world!")))
  };
  let mut chain = Chain::new(handler);
  chain.link_around(CorsMiddleware::permissive());
  let mut listening = Iron::new(chain).http("localhost:0").unwrap();
  listening.close().unwrap();
}

Documentation

https://atorstling.github.io/corsware/corsware/index.html

Links

Origin Spec

Origin Casemap Spec

Commit count: 0

cargo fmt