github-actions[bot] commented on code in PR #62110:
URL: https://github.com/apache/doris/pull/62110#discussion_r3083857896
##########
be/src/service/http/action/stream_load.cpp:
##########
@@ -906,9 +906,16 @@ Status StreamLoadAction::_check_wal_space(const
std::string& group_commit_mode,
Status StreamLoadAction::_can_group_commit(HttpRequest* req,
std::shared_ptr<StreamLoadContext> ctx,
std::string& group_commit_header,
bool& can_group_commit) {
- int64_t content_length = req->header(HttpHeaders::CONTENT_LENGTH).empty()
- ? 0
- :
std::stoll(req->header(HttpHeaders::CONTENT_LENGTH));
+ int64_t content_length = 0;
+ const auto& content_length_str = req->header(HttpHeaders::CONTENT_LENGTH);
Review Comment:
This validation is still bypassed when the client explicitly sends
`group_commit: off_mode`. `_handle_group_commit()` returns early for `off_mode`
before calling `_can_group_commit()`, so a request such as `Content-Length: -2`
can still flow into `_on_header()`, store `ctx->body_bytes = -2`, and later
reach `_process_put()`. In the streaming path that can construct
`StreamLoadPipe(..., -2)`, which is then rejected later as an internal
`_total_length < -1` error instead of an early `InvalidArgument` for bad user
input. The `Content-Length` validation needs to be shared with the `off_mode`
path as well, or moved to a common validation point before the early return.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]