fix: move cors layer under trace layer
This commit is contained in:
parent
3dfb432b0f
commit
f56e808bc6
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,6 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
|
||||||
use tower_http::{cors::CorsLayer, trace::TraceLayer};
|
use tower_http::{cors::CorsLayer, trace::TraceLayer};
|
||||||
|
|
||||||
let router = axum::Router::new()
|
let router = axum::Router::new()
|
||||||
.layer(CorsLayer::permissive())
|
|
||||||
.layer(
|
.layer(
|
||||||
// TODO 4xx errors aren't really failures but since upub is in development it's useful to log
|
// TODO 4xx errors aren't really failures but since upub is in development it's useful to log
|
||||||
// these too, in case something's broken
|
// these too, in case something's broken
|
||||||
|
@ -39,6 +38,7 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
.layer(CorsLayer::permissive())
|
||||||
.ap_routes()
|
.ap_routes()
|
||||||
.mastodon_routes() // no-op if mastodon feature is disabled
|
.mastodon_routes() // no-op if mastodon feature is disabled
|
||||||
.with_state(ctx);
|
.with_state(ctx);
|
||||||
|
|
Loading…
Reference in a new issue