mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
Set request payload limit to 10 MB (#429)
V3_GIT_ORIGIN_REV_ID: b0377caff0cb6c65b51179037e09e6eae9dc3bfb
This commit is contained in:
parent
8bee92864d
commit
cc9cedc268
@ -5,7 +5,7 @@ use std::sync::Arc;
|
||||
|
||||
use axum::{
|
||||
body::HttpBody,
|
||||
extract::State,
|
||||
extract::{DefaultBodyLimit, State},
|
||||
http::{HeaderMap, Request},
|
||||
middleware::Next,
|
||||
response::{Html, IntoResponse},
|
||||
@ -168,12 +168,15 @@ async fn start_engine(server: &ServerOptions) -> Result<(), StartupError> {
|
||||
|
||||
let health_route = Router::new().route("/health", get(handle_health));
|
||||
|
||||
const MB: usize = 1_048_576;
|
||||
|
||||
let app = Router::new()
|
||||
// serve graphiql at root
|
||||
.route("/", get(graphiql))
|
||||
.merge(graphql_route)
|
||||
.merge(explain_route)
|
||||
.merge(health_route);
|
||||
.merge(health_route)
|
||||
.layer(DefaultBodyLimit::max(10 * MB)); // Set request payload limit to 10 MB
|
||||
|
||||
// The "unspecified" IPv6 address will match any IPv4 or IPv6 address.
|
||||
let host = net::IpAddr::V6(net::Ipv6Addr::UNSPECIFIED);
|
||||
|
Loading…
Reference in New Issue
Block a user