We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm testing with real torrents like this:
http://academictorrents.com/details/b8287ebfa04f879b048d4d4404108cf3e8014352
I get a Bad Request response trying to upload the torrent to the backend. I think the problem is the torrent is too big (2.2MB).
Bad Request
I've been debugging, and the error is thrown here.
while let Some(chunk) = field.chunk().await.map_err(|_| (ServiceError::BadRequest))? { torrent_cursor.write_all(&chunk)?; }
I am still determining the reason. I must first check if the backend is receiving the whole torrent data.
The text was updated successfully, but these errors were encountered:
The default body size limit is 2 MB.
You can increase it by adding a layer to the router:
router.layer(DefaultBodyLimit::max(5_242_880))
Full router config:
pub fn router(app_data: Arc<AppData>) -> Router { let v1_api_routes = Router::new() .route("/", get(about_page_handler).with_state(app_data.clone())) .nest("/user", user::routes::router(app_data.clone())) .nest("/about", about::routes::router(app_data.clone())) .nest("/category", category::routes::router(app_data.clone())) .nest("/tag", tag::routes::router_for_single_resources(app_data.clone())) .nest("/tags", tag::routes::router_for_multiple_resources(app_data.clone())) .nest("/settings", settings::routes::router(app_data.clone())) .nest("/torrent", torrent::routes::router_for_single_resources(app_data.clone())) .nest("/torrents", torrent::routes::router_for_multiple_resources(app_data.clone())) .nest("/proxy", proxy::routes::router(app_data.clone())); let router = Router::new() .route("/", get(about_page_handler).with_state(app_data)) .nest(&format!("/{API_VERSION_URL_PREFIX}"), v1_api_routes); let router = if env::var(ENV_VAR_CORS_PERMISSIVE).is_ok() { router.layer(CorsLayer::permissive()) } else { router }; router.layer(DefaultBodyLimit::max(5_242_880)) }
For now, I'm going to increase it to 10MB. I will open a new issue to add a config option to define this limit.
Sorry, something went wrong.
I've tested it with a 4.7MB torrent containing 39963 files.
c398a571976c78d346c325bd75c47b82edf6124e.zip
Successfully merging a pull request may close this issue.
I'm testing with real torrents like this:
http://academictorrents.com/details/b8287ebfa04f879b048d4d4404108cf3e8014352
I get a
Bad Request
response trying to upload the torrent to the backend. I think the problem is the torrent is too big (2.2MB).I've been debugging, and the error is thrown here.
I am still determining the reason. I must first check if the backend is receiving the whole torrent data.
The text was updated successfully, but these errors were encountered: