mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
avoid chunked here
This commit is contained in:
@@ -663,7 +663,7 @@ pub fn buildRequest(this: *HTTPClient, body_len: usize) picohttp.Request {
|
||||
|
||||
if (body_len > 0 or this.method.hasRequestBody()) {
|
||||
if (this.flags.is_streaming_request_body) {
|
||||
if (add_transfer_encoding) {
|
||||
if (add_transfer_encoding and this.flags.upgrade_state == .none) {
|
||||
request_headers_buf[header_count] = chunked_encoded_header;
|
||||
header_count += 1;
|
||||
}
|
||||
|
||||
@@ -323,8 +323,8 @@ fn drainEvents(this: *@This()) void {
|
||||
if (client.state.original_request_body == .stream) {
|
||||
var stream = &client.state.original_request_body.stream;
|
||||
stream.ended = ended;
|
||||
if (messageType == .endChunked) {
|
||||
// only send the 0-length chunk if the request body is chunked
|
||||
if (messageType == .endChunked and client.flags.upgrade_state != .upgraded) {
|
||||
// only send the 0-length chunk if the request body is chunked and not upgraded
|
||||
client.writeToStream(is_tls, socket, bun.http.end_of_chunked_http1_1_encoding_response_body);
|
||||
} else {
|
||||
client.flushStream(is_tls, socket);
|
||||
|
||||
Reference in New Issue
Block a user