Skip to content

Commit bea7dc4

Browse files
committed
Fix tests
1 parent ff8577b commit bea7dc4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

source/s3express_credentials_provider.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,9 @@ static struct aws_http_message *s_create_session_request_new(
405405
.name = g_host_header_name,
406406
.value = host_value,
407407
};
408-
409-
/* NOTE: ONLY FOR TESTS. Don't add the host header for endpoint override. */
408+
/* NOTE: Only for Tests.
409+
* Don't add the host header for endpoint override.
410+
*/
410411
if (endpoint_override == NULL) {
411412
if (aws_http_message_add_header(request, host_header)) {
412413
goto error;
@@ -443,7 +444,10 @@ static struct aws_http_message *s_create_session_request_new(
443444
struct aws_byte_cursor path_and_query = s_create_session_path_query;
444445
if (endpoint_override != NULL) {
445446
const struct aws_byte_cursor *override_path_query = aws_uri_path_and_query(endpoint_override);
446-
if (override_path_query->len > 0) {
447+
/* NOTE: Only for Tests.
448+
* path_and_query is at least 1 due to /. Only override if its length is more than 1
449+
*/
450+
if (override_path_query->len > 1) {
447451
path_and_query = *override_path_query;
448452
}
449453
}
@@ -486,7 +490,7 @@ struct aws_string *aws_encode_s3express_hash_key_new(
486490
const struct aws_credentials *original_credentials,
487491
struct aws_byte_cursor host_value,
488492
struct aws_http_headers *headers) {
489-
(void)headers;
493+
490494
struct aws_byte_buf combined_hash_buf;
491495

492496
/* 1. Combine access_key and secret_access_key into one buffer */

tests/s3_mock_server_s3express_provider_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ struct aws_s3express_credentials_provider *s_s3express_credentials_provider_fact
269269
s_s3express_tester.shutdown_user_data = shutdown_user_data;
270270
struct aws_s3express_credentials_provider_default_options options = {
271271
.client = client,
272-
// .shutdown_complete_callback = s_on_shutdown_complete,
273-
// .shutdown_user_data = &s_s3express_tester,
274272
.mock_test.bg_refresh_secs_override = s_bg_refresh_secs_override,
275273
};
276274
struct aws_s3express_credentials_provider *provider =

0 commit comments

Comments
 (0)