Commit 06fb0a03 authored by Konrad Borowski's avatar Konrad Borowski

Merge branch 'cors' into 'master'

Enable CORS for API

See merge request pastebin.run/server!68
parents 078bcfcd eb6659fb
Pipeline #93346664 passed with stage
in 8 minutes and 56 seconds
......@@ -123,7 +123,10 @@ fn api_v1(pool: PgPool) -> BoxedFilter<(impl Reply,)> {
.and(warp::body::form())
.and(connection(pool))
.and_then(api_v1::pastes::insert_paste);
path!("api" / "v1").and(languages.or(pastes)).boxed()
path!("api" / "v1")
.and(languages.or(pastes))
.with(warp::cors().allow_any_origin())
.boxed()
}
fn static_dir() -> BoxedFilter<(impl Reply,)> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment