Skip to content

Commit c737053

Browse files
committed
adding two more headers to filter
1 parent 2fb1451 commit c737053

4 files changed

Lines changed: 10 additions & 0 deletions

File tree

include/aws/http/private/http_impl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ enum aws_http_header_name {
6767
AWS_HTTP_HEADER_UPGRADE,
6868
AWS_HTTP_HEADER_KEEP_ALIVE,
6969
AWS_HTTP_HEADER_PROXY_CONNECTION,
70+
AWS_HTTP_HEADER_SIGNING_SECURITY_TOKEN,
71+
AWS_HTTP_HEADER_SIGNING_S3SESSION_TOKEN,
7072

7173
AWS_HTTP_HEADER_COUNT, /* Number of enums */
7274
};

source/h1_stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ struct aws_h1_stream *aws_h1_stream_new_request(
440440
enum aws_http_header_name name_enum = aws_http_str_to_header_name(header.name);
441441
switch (name_enum) {
442442
case AWS_HTTP_HEADER_AUTHORIZATION:
443+
case AWS_HTTP_HEADER_SIGNING_SECURITY_TOKEN:
444+
case AWS_HTTP_HEADER_SIGNING_S3SESSION_TOKEN:
445+
/* TODO: move the filter to SDKs, not the http client. */
443446
/* Sensitive header, do not log the value of the header */
444447
AWS_LOGF_TRACE(
445448
AWS_LS_HTTP_STREAM,

source/h2_stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,9 @@ int aws_h2_stream_on_activated(struct aws_h2_stream *stream, enum aws_h2_stream_
774774
aws_raise_error(AWS_ERROR_HTTP_INVALID_HEADER_FIELD);
775775
goto error;
776776
case AWS_HTTP_HEADER_AUTHORIZATION:
777+
case AWS_HTTP_HEADER_SIGNING_SECURITY_TOKEN:
778+
case AWS_HTTP_HEADER_SIGNING_S3SESSION_TOKEN:
779+
/* TODO: move the filter to SDKs, not the http client. */
777780
/* Sensitive header, do not log the value of the header */
778781
AWS_H2_STREAM_LOGF(TRACE, stream, "Sending header: " PRInSTR ": ***", AWS_BYTE_CURSOR_PRI(header.name));
779782
break;

source/http.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ static void s_headers_init(struct aws_allocator *alloc) {
339339
s_header_enum_to_str[AWS_HTTP_HEADER_UPGRADE] = aws_byte_cursor_from_c_str("upgrade");
340340
s_header_enum_to_str[AWS_HTTP_HEADER_KEEP_ALIVE] = aws_byte_cursor_from_c_str("keep-alive");
341341
s_header_enum_to_str[AWS_HTTP_HEADER_PROXY_CONNECTION] = aws_byte_cursor_from_c_str("proxy-connection");
342+
s_header_enum_to_str[AWS_HTTP_HEADER_SIGNING_SECURITY_TOKEN] = aws_byte_cursor_from_c_str("x-amz-security-token");
343+
s_header_enum_to_str[AWS_HTTP_HEADER_SIGNING_S3SESSION_TOKEN] = aws_byte_cursor_from_c_str("x-amz-s3session-token");
342344

343345
s_init_str_to_enum_hash_table(
344346
&s_header_str_to_enum,

0 commit comments

Comments
 (0)