Skip to content

Commit 7242285

Browse files
committed
bugfix
1 parent 89b28d5 commit 7242285

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

source/h1_encoder.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,6 @@ static int s_scan_outgoing_headers(
150150
return AWS_OP_SUCCESS;
151151
}
152152

153-
static int s_validate_manual_data_writes(const struct aws_h1_encoder_message *encoder_message, bool has_body_stream) {
154-
155-
/* Manual data writes require either Content-Length or chunked encoding.
156-
* Note: Transfer-Encoding: chunked is automatically added by h1_stream if neither header is present. */
157-
AWS_ASSERT(encoder_message->content_length > 0 || encoder_message->has_chunked_encoding_header);
158-
159-
/* Manual data writes cannot have body stream */
160-
if (has_body_stream) {
161-
AWS_LOGF_ERROR(AWS_LS_HTTP_STREAM, "id=static: Manual data writes cannot have body stream");
162-
return aws_raise_error(AWS_ERROR_HTTP_INVALID_HEADER_FIELD);
163-
}
164-
165-
return AWS_OP_SUCCESS;
166-
}
167-
168153
static int s_scan_outgoing_trailer(const struct aws_http_headers *headers, size_t *out_size) {
169154
const size_t num_headers = aws_http_headers_count(headers);
170155
size_t total = 0;
@@ -320,8 +305,9 @@ int aws_h1_encoder_message_init_from_request(
320305

321306
/* Validate manual data writes configuration */
322307
if (use_manual_data_writes) {
323-
err = s_validate_manual_data_writes(message, message->body != NULL);
324-
if (err) {
308+
if (message->body != NULL) {
309+
AWS_LOGF_ERROR(AWS_LS_HTTP_STREAM, "id=static: Manual data writes cannot have body stream");
310+
aws_raise_error(AWS_ERROR_HTTP_INVALID_STATUS_CODE);
325311
goto error;
326312
}
327313
/* Content-Length manual writes use pending_data_write_list.

0 commit comments

Comments
 (0)