From 5e57569de4119081211691eb3fa316e3508172a8 Mon Sep 17 00:00:00 2001 From: Jianping Chen Date: Tue, 6 Jul 2021 10:17:32 -0700 Subject: [PATCH] [Communication]: Remove Date header added by Hmac Policy (#22574) * Remove Date header added by Hmac Policy * Revert Phone number session records * Revert all recorded sessions * Remove extra file * A trivial change to reset PR build Co-authored-by: JP Chen --- sdk/communication/azure-communication-common/README.md | 2 +- .../common/implementation/HmacAuthenticationPolicy.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/communication/azure-communication-common/README.md b/sdk/communication/azure-communication-common/README.md index 0c61688076bae..eb6553634f226 100644 --- a/sdk/communication/azure-communication-common/README.md +++ b/sdk/communication/azure-communication-common/README.md @@ -1,7 +1,7 @@ # Azure Communication Service Common client library for Java Azure Communication Common contains data structures commonly used for communicating with Azure Communication Services. -It is intended to provide cross cutting concerns, e.g. authentication. +It is intended to provide cross-cutting concerns, e.g. authentication. ## Getting started diff --git a/sdk/communication/azure-communication-common/src/main/java/com/azure/communication/common/implementation/HmacAuthenticationPolicy.java b/sdk/communication/azure-communication-common/src/main/java/com/azure/communication/common/implementation/HmacAuthenticationPolicy.java index 890ef1496eed4..e4d281d67042c 100644 --- a/sdk/communication/azure-communication-common/src/main/java/com/azure/communication/common/implementation/HmacAuthenticationPolicy.java +++ b/sdk/communication/azure-communication-common/src/main/java/com/azure/communication/common/implementation/HmacAuthenticationPolicy.java @@ -37,7 +37,6 @@ * HttpPipelinePolicy to append CommunicationClient required headers */ public final class HmacAuthenticationPolicy implements HttpPipelinePolicy { - private static final String DATE_HEADER = "date"; private static final String X_MS_DATE_HEADER = "x-ms-date"; private static final String X_MS_STRING_TO_SIGN_HEADER = "x-ms-hmac-string-to-sign-base64"; private static final String HOST_HEADER = "host"; @@ -122,7 +121,6 @@ private Map addAuthenticationHeaders(final URL url, String utcNow = OffsetDateTime.now(ZoneOffset.UTC) .format(HMAC_DATETIMEFORMATTER_PATTERN); headers.put(X_MS_DATE_HEADER, utcNow); - headers.put(DATE_HEADER, utcNow); headers.put(HOST_HEADER, url.getHost()); addSignatureHeader(url, httpMethod, headers); return headers;