Skip to content

Commit

Permalink
[fix](stream_load)fix bug when stream without content-length or chunk…
Browse files Browse the repository at this point in the history
…ed Transfer Encoding
  • Loading branch information
alexxing662 committed Nov 29, 2023
1 parent c30299c commit 53d2d2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions be/src/http/action/stream_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ Status StreamLoadAction::_on_header(HttpRequest* http_req, std::shared_ptr<Strea
}
}

if (ctx->body_bytes == 0 && !ctx->is_chunked_transfer) {
return Status::InternalError(
"content_length is empty and transfer-encoding!=chunked, please set content_length "
"or transfer-encoding=chunked");
}

if (!http_req->header(HTTP_TIMEOUT).empty()) {
try {
ctx->timeout_second = std::stoi(http_req->header(HTTP_TIMEOUT));
Expand Down

0 comments on commit 53d2d2a

Please sign in to comment.