@@ -401,17 +401,17 @@ static struct aws_http_message *s_create_session_request_new(
401
401
const struct aws_uri * endpoint_override ) {
402
402
struct aws_http_message * request = aws_http_message_new_request (allocator );
403
403
404
+ struct aws_byte_cursor host = host_value ;
405
+ /* NOTE: Only for Tests. */
406
+ if (endpoint_override != NULL ) {
407
+ host = * aws_uri_host_name (endpoint_override );
408
+ }
404
409
struct aws_http_header host_header = {
405
410
.name = g_host_header_name ,
406
- .value = host_value ,
411
+ .value = host ,
407
412
};
408
- /* NOTE: Only for Tests.
409
- * Don't add the host header for endpoint override.
410
- */
411
- if (endpoint_override == NULL ) {
412
- if (aws_http_message_add_header (request , host_header )) {
413
- goto error ;
414
- }
413
+ if (aws_http_message_add_header (request , host_header )) {
414
+ goto error ;
415
415
}
416
416
417
417
struct aws_http_header user_agent_header = {
@@ -571,8 +571,6 @@ static struct aws_s3express_session_creator *s_session_creator_new(
571
571
.body_callback = s_on_incoming_body_fn ,
572
572
.finish_callback = s_on_request_finished ,
573
573
.signing_config = & s3express_signing_config ,
574
- /* Override endpoint only for tests. */
575
- .endpoint = impl -> mock_test .endpoint_override ? impl -> mock_test .endpoint_override : NULL ,
576
574
.user_data = session_creator ,
577
575
.operation_name = aws_byte_cursor_from_c_str ("CreateSession" ),
578
576
};
0 commit comments