Skip to content

Commit

Permalink
[Communication]: Remove Date header added by Hmac Policy (#22574)
Browse files Browse the repository at this point in the history
* 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 <jiach@microsoft.com>
  • Loading branch information
JianpingChen and JP Chen authored Jul 6, 2021
1 parent c4643ce commit 5e57569
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion sdk/communication/azure-communication-common/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -122,7 +121,6 @@ private Map<String, String> 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;
Expand Down

0 comments on commit 5e57569

Please sign in to comment.