Skip to content

Commit

Permalink
Increase the request string limit
Browse files Browse the repository at this point in the history
Resolves #2
  • Loading branch information
Hamuko committed Jan 15, 2024
1 parent 0126739 commit cdab02d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mod plex;
use clap::Parser;
use data::context::Anime;
use log::{debug, error, info, warn, LevelFilter};
use rocket::data::{Limits, ToByteUnit};
use rocket::form::Form;
use rocket::response::Redirect;
use rocket_dyn_templates::{context, Template};
Expand Down Expand Up @@ -170,8 +171,14 @@ async fn main() {
// single template inside the binary, we need to make a dummy directory for anifunnel.
let dir = tempdir().unwrap();

// Increase the string limit from default since Plex might send the thumbnail in some
// requests and we don't want those to cause unnecessary HTTP 413 Content Too Large
// errors (even though we don't use those requests).
let limits = Limits::default().limit("string", 24.kibibytes());

// Launch the web server.
let figment = rocket::Config::figment()
.merge(("limits", limits))
.merge(("port", args.port))
.merge(("address", args.bind_address))
.merge(("template_dir", dir.path()));
Expand Down

0 comments on commit cdab02d

Please sign in to comment.