Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Communication]: Remove Date header added by Hmac Policy #22574

Merged
merged 5 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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