File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
168153static 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.
You can’t perform that action at this time.
0 commit comments