-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
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
Error trying to upload a "big" torrent file #255
Comments
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. |
3 tasks
I've tested it with a 4.7MB torrent containing 39963 files. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: