diff --git a/src/Private/CanonicalRequest.cs b/src/Private/CanonicalRequest.cs index 964d5d34..6a1f1369 100644 --- a/src/Private/CanonicalRequest.cs +++ b/src/Private/CanonicalRequest.cs @@ -45,6 +45,11 @@ public static class CanonicalRequest "trailer", "transfer-encoding", "upgrade", + "user-agent", + "via", + "x-forwarded-for", + "x-forwarded-port", + "x-forwarded-proto", HeaderKeys.XAmznTraceIdHeader ]; diff --git a/test/Unit/Private/CanonicalRequestShould.cs b/test/Unit/Private/CanonicalRequestShould.cs index 9933ff8b..942697af 100644 --- a/test/Unit/Private/CanonicalRequestShould.cs +++ b/test/Unit/Private/CanonicalRequestShould.cs @@ -34,9 +34,14 @@ public CanonicalRequestShould(TestSuiteContext context) new[] { "TE", "gzip"}, new[] { "Trailer", "Expires"}, new[] { "Transfer-Encoding", "gzip"}, - new[] { "Upgrade", "websocket"} + new[] { "Upgrade", "websocket"}, + new[] { "User-Agent", "curl/7.64.1"}, + new[] { "Via", "HTTP/1.1 my_proxy"}, + new[] { "X-Forwarded-For", "203.0.113.195"}, + new[] { "X-Forwarded-Port", "443"}, + new[] { "X-Forwarded-Proto", "http"}, }; - + [Theory] [InlineData("get-header-key-duplicate")] @@ -261,7 +266,7 @@ internal static void AddUnsignableHeaders(HttpRequestMessage request) foreach (var testCase in UnsignableHeadersTestCases) { var headerName = (string)testCase[0]; - var headerValue = (string)testCase[0]; + var headerValue = (string)testCase[1]; // Exclude the following headers due to them failing if (headerValue is "Range" or "Transfer-Encoding")