{"action":"created","issue":{"url":"https://api.github.com/repos/actix/actix-web/issues/93","repository_url":"https://api.github.com/repos/actix/actix-web","labels_url":"https://api.github.com/repos/actix/actix-web/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/actix/actix-web/issues/93/comments","events_url":"https://api.github.com/repos/actix/actix-web/issues/93/events","html_url":"https://github.com/actix/actix-web/issues/93","id":302094321,"number":93,"title":"request with a gzipped body with a length > 8192 before compression ends with a 400 response","user":{"login":"mockersf","id":8672791,"avatar_url":"https://avatars3.githubusercontent.com/u/8672791?v=4","gravatar_id":"","url":"https://api.github.com/users/mockersf","html_url":"https://github.com/mockersf","followers_url":"https://api.github.com/users/mockersf/followers","following_url":"https://api.github.com/users/mockersf/following{/other_user}","gists_url":"https://api.github.com/users/mockersf/gists{/gist_id}","starred_url":"https://api.github.com/users/mockersf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mockersf/subscriptions","organizations_url":"https://api.github.com/users/mockersf/orgs","repos_url":"https://api.github.com/users/mockersf/repos","events_url":"https://api.github.com/users/mockersf/events{/privacy}","received_events_url":"https://api.github.com/users/mockersf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-04T15:25:30Z","updated_at":"2018-03-04T18:39:22Z","closed_at":"2018-03-04T18:16:58Z","author_association":"NONE","body":"There are requests ending in BAD_REQUEST on my actix-web server.\r\nthe log: \r\n```\r\n[2018-03-04 03:57:35.367266000] [actix_web::pipeline] [WARN] Error occured during request handling: bad request\r\n[2018-03-04 03:57:35.367354000] [actix_web::pipeline] [DEBUG] BadRequest(\"EOF while parsing a string at line 1 column 2807\")\r\n\r\nstack backtrace:\r\n   0:        0x104b91184 - backtrace::backtrace::trace::hc6e89d4945e2c2a8\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.5/src/backtrace/mod.rs:42\r\n   1:        0x104b8816c - backtrace::capture::Backtrace::new_unresolved::h3958ffc308d0abf9\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.5/src/capture.rs:88\r\n   2:        0x104b864c7 - failure::backtrace::internal::InternalBacktrace::new::hedfa704dddf7f646\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/backtrace/internal.rs:44\r\n   3:        0x104b86cce - failure::backtrace::Backtrace::new::h00bdb0982e7d7e20\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/backtrace/mod.rs:98\r\n   4:        0x1043be900 - _$LT$actix_web..error..Error$u20$as$u20$core..convert..From$LT$T$GT$$GT$::from::h4da69b3fa82b9dd8\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/error.rs:89\r\n   5:        0x1044eaa19 - _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h40515bbf2cc63852\r\n                        at /Users/travis/build/rust-lang/rust/src/libcore/convert.rs:415\r\n   6:        0x10423a3f9 - _$LT$alloc..boxed..Box$LT$futures..future..Future$LT$Error$u3d$E$C$$u20$Item$u3d$I$GT$$u20$$u2b$$u20$$u27$static$GT$$u20$as$u20$actix_web..handler..Responder$GT$::respond_to::_$u7b$$u7b$closure$u7d$$u7d$::he931a0fa5f0a0d80\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/handler.rs:182\r\n   7:        0x10402947b - _$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::map_err::h18909176b8e55f57\r\n                        at /Users/travis/build/rust-lang/rust/src/libcore/result.rs:500\r\n   8:        0x10428055e - _$LT$futures..future..map_err..MapErr$LT$A$C$$u20$F$GT$$u20$as$u20$futures..future..Future$GT$::poll::h466f4396169c4d50\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/future/map_err.rs:34\r\n   9:        0x104290773 - _$LT$futures..future..chain..Chain$LT$A$C$$u20$B$C$$u20$C$GT$$GT$::poll::hc3a69b0055d1bc2a\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/future/chain.rs:26\r\n  10:        0x1043ba1ab - _$LT$futures..future..then..Then$LT$A$C$$u20$B$C$$u20$F$GT$$u20$as$u20$futures..future..Future$GT$::poll::hb27ee3fc520862f1\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/future/then.rs:32\r\n  11:        0x10427b1fb - _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$futures..future..Future$GT$::poll::h5d0aeb90f7a6eb3d\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/future/mod.rs:113\r\n  12:        0x10430ae32 - _$LT$actix_web..pipeline..WaitingResponse$LT$S$C$$u20$H$GT$$GT$::poll::ha590023b3c2c094b\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/pipeline.rs:315\r\n  13:        0x1042ffda7 - _$LT$actix_web..pipeline..PipelineState$LT$S$C$$u20$H$GT$$GT$::poll::hb829cdb2d096c432\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/pipeline.rs:53\r\n  14:        0x1042fdfa9 - _$LT$actix_web..pipeline..Pipeline$LT$S$C$$u20$H$GT$$u20$as$u20$actix_web..server..HttpHandlerTask$GT$::poll_io::ha76ada8214032615\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/pipeline.rs:181\r\n  15:        0x1040d6ed7 - _$LT$actix_web..server..h1..Http1$LT$T$C$$u20$H$GT$$GT$::poll_io::h70f24b75e442bd33\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/server/h1.rs:211\r\n  16:        0x1040d60c0 - _$LT$actix_web..server..h1..Http1$LT$T$C$$u20$H$GT$$GT$::poll::he82b45278bd8f05a\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/server/h1.rs:105\r\n  17:        0x10429a609 - _$LT$actix_web..server..channel..HttpChannel$LT$T$C$$u20$H$GT$$u20$as$u20$futures..future..Future$GT$::poll::haea83a046365ae8c\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/server/channel.rs:94\r\n  18:        0x10429b0fd - _$LT$actix_web..server..channel..HttpChannel$LT$T$C$$u20$H$GT$$u20$as$u20$futures..future..Future$GT$::poll::haea83a046365ae8c\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-0.4.2/src/server/channel.rs:144\r\n  19:        0x1049aefe4 - _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$futures..future..Future$GT$::poll::h84ca8e2cc26d549b\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/future/mod.rs:113\r\n  20:        0x1049b6854 - _$LT$futures..task_impl..Spawn$LT$T$GT$$GT$::poll_future_notify::_$u7b$$u7b$closure$u7d$$u7d$::h384dbcaaed12827a\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/mod.rs:289\r\n  21:        0x1049b6c0a - _$LT$futures..task_impl..Spawn$LT$T$GT$$GT$::enter::_$u7b$$u7b$closure$u7d$$u7d$::h1c921f64b2ec7b77\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/mod.rs:363\r\n  22:        0x1049c5818 - futures::task_impl::std::set::h45365c33682357d1\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/std/mod.rs:78\r\n  23:        0x1049b6a70 - _$LT$futures..task_impl..Spawn$LT$T$GT$$GT$::enter::h217aeac9d76d76fa\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/mod.rs:363\r\n  24:        0x1049b6829 - _$LT$futures..task_impl..Spawn$LT$T$GT$$GT$::poll_future_notify::hb9760ac760efc116\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/mod.rs:289\r\n  25:        0x1049bb2d8 - tokio_core::reactor::Core::dispatch_task::_$u7b$$u7b$closure$u7d$$u7d$::h072d904ae1a7e706\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.12/src/reactor/mod.rs:359\r\n  26:        0x1049c22c4 - _$LT$scoped_tls..ScopedKey$LT$T$GT$$GT$::set::h14e21bce1fe9dbc7\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.1/src/lib.rs:155\r\n  27:        0x1049bac21 - tokio_core::reactor::Core::dispatch_task::h2a51e766030781e1\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.12/src/reactor/mod.rs:358\r\n  28:        0x1049ba004 - tokio_core::reactor::Core::dispatch::h3712bbe3f0509eb9\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.12/src/reactor/mod.rs:319\r\n  29:        0x1049b9b37 - tokio_core::reactor::Core::poll::hade3e1dff0dd39df\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.12/src/reactor/mod.rs:307\r\n  30:        0x1042034d2 - tokio_core::reactor::Core::run::h1c0c6402dbf0e32d\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.12/src/reactor/mod.rs:241\r\n  31:        0x10403ec05 - actix::arbiter::Arbiter::new::_$u7b$$u7b$closure$u7d$$u7d$::h2b65c573348d70c5\r\n                        at /Users/francoism/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-0.5.1/src/arbiter.rs:89\r\n  32:        0x104439864 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5f4687771c3d17c7\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/sys_common/backtrace.rs:133\r\n  33:        0x10405eabb - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h433cc9bd96ce7640\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/thread/mod.rs:406\r\n  34:        0x1042f4324 - _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hd3cbebba59acd924\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/panic.rs:300\r\n  35:        0x1041ffe04 - std::panicking::try::do_call::h29aca169b5ad0a57\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:480\r\n  36:        0x104bfcbbe - __rust_maybe_catch_panic\r\n                        at src/libpanic_unwind/lib.rs:101\r\n  37:        0x1041ffbfc - std::panicking::try::h2acd48c1561c30fb\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:459\r\n  38:        0x1042f437c - std::panic::catch_unwind::h68508059648708db\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/panic.rs:365\r\n  39:        0x10405e8e8 - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::h698d5def2a42aae2\r\n                        at /Users/travis/build/rust-lang/rust/src/libstd/thread/mod.rs:405\r\n  40:        0x10405eb45 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h2a13bd42a788e03e\r\n                        at /Users/travis/build/rust-lang/rust/src/liballoc/boxed.rs:815\r\n  41:        0x104beb1f7 - std::sys_common::thread::start_thread::h955915a516ba675d\r\n                        at src/libstd/sys_common/thread.rs:24\r\n  42:        0x104bef0d8 - std::sys::unix::thread::Thread::new::thread_start::h9cf88adb0b0cce85\r\n                        at src/libstd/sys/unix/thread.rs:90\r\n  43:     0x7fffcd34293a - _pthread_body\r\n  44:     0x7fffcd342886 - _pthread_start\r\n```\r\nAfter disabling gzip compression in my client, the error didn't happen anymore.\r\n\r\nI digged a little into the tests, and noticed that in tests/test_server.rs, if I increase the size of STR to be longer than 8193 chars, tests starts failing or not stopping:\r\n```\r\n     Running target/debug/deps/test_server-9d7e340c3dd02fce\r\n\r\nrunning 22 tests\r\ntest test_application ... ok\r\ntest test_body_chunked_implicit ... ok\r\ntest test_body_length ... ok\r\ntest test_deflate_encoding ... FAILED\r\ntest test_gzip_encoding ... FAILED\r\ntest test_h2 ... ok\r\ntest test_head_binary ... ok\r\ntest test_head_binary2 ... ok\r\ntest test_head_empty ... ok\r\ntest test_body_chunked_explicit ... ok\r\ntest test_body_br_streaming ... ok\r\ntest test_body_gzip ... ok\r\ntest test_body_deflate ... ok\r\ntest test_body ... FAILED\r\ntest test_body_brotli ... ok\r\ntest test_middlewares ... ok\r\ntest test_resource_middlewares ... ok\r\ntest test_simple ... ok\r\ntest test_headers ... FAILED\r\ntest test_start ... ok\r\ntest test_shutdown ... ok\r\ntest test_brotli_encoding has been running for over 60 seconds\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/actix/actix-web/issues/comments/370252392","html_url":"https://github.com/actix/actix-web/issues/93#issuecomment-370252392","issue_url":"https://api.github.com/repos/actix/actix-web/issues/93","id":370252392,"user":{"login":"fafhrd91","id":598990,"avatar_url":"https://avatars2.githubusercontent.com/u/598990?v=4","gravatar_id":"","url":"https://api.github.com/users/fafhrd91","html_url":"https://github.com/fafhrd91","followers_url":"https://api.github.com/users/fafhrd91/followers","following_url":"https://api.github.com/users/fafhrd91/following{/other_user}","gists_url":"https://api.github.com/users/fafhrd91/gists{/gist_id}","starred_url":"https://api.github.com/users/fafhrd91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fafhrd91/subscriptions","organizations_url":"https://api.github.com/users/fafhrd91/orgs","repos_url":"https://api.github.com/users/fafhrd91/repos","events_url":"https://api.github.com/users/fafhrd91/events{/privacy}","received_events_url":"https://api.github.com/users/fafhrd91/received_events","type":"User","site_admin":false},"created_at":"2018-03-04T18:39:22Z","updated_at":"2018-03-04T18:39:22Z","author_association":"COLLABORATOR","body":"i will make new release later today"}}
{"actor":{"display_login":"fafhrd91"}}