diff options
author | lavv17 <lavv17@yandex-team.com> | 2024-10-24 11:47:12 +0300 |
---|---|---|
committer | lavv17 <lavv17@yandex-team.com> | 2024-10-24 12:42:58 +0300 |
commit | 9960b0da4f3db74c4d066c3aefaea06c9404752a (patch) | |
tree | b00e6378ad148dfb4a6ff9364cd298ed4c87d814 /library/cpp/http/server/http_ex.cpp | |
parent | fba670c06e2d0b4b3274e4afcc2daeaf04e78380 (diff) | |
download | ydb-9960b0da4f3db74c4d066c3aefaea06c9404752a.tar.gz |
check POST data length to match Content-Length
commit_hash:9f66fdc1ffe8653fba7144bff4dbee4b92723b50
Diffstat (limited to 'library/cpp/http/server/http_ex.cpp')
-rw-r--r-- | library/cpp/http/server/http_ex.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/cpp/http/server/http_ex.cpp b/library/cpp/http/server/http_ex.cpp index fc43d2defc..0681da10ff 100644 --- a/library/cpp/http/server/http_ex.cpp +++ b/library/cpp/http/server/http_ex.cpp @@ -87,7 +87,8 @@ bool THttpClientRequestExtension::ProcessHeaders(TBaseServerRequestData& rd, TBl } TBuffer buf(SafeIntegerCast<size_t>(contentLength)); - buf.Resize(Input().Load(buf.Data(), (size_t)contentLength)); + Input().LoadOrFail(buf.Data(), (size_t)contentLength); + buf.Resize((size_t)contentLength); postData = TBlob::FromBuffer(buf); } else { postData = TBlob::FromStream(Input()); |