From 8b8617ecc9bdb18fe114bf9f1b0130f613500886 Mon Sep 17 00:00:00 2001 From: Subash Pradhan Date: Tue, 22 Oct 2024 12:27:32 +0200 Subject: [PATCH] Adding unreleased functionality in the changelogs to keep track of current version --- CHANGELOG.md | 3 +++ src/main/kotlin/com/nylas/NylasClient.kt | 1 + .../com/nylas/interceptors/AddVersionHeadersInterceptor.kt | 1 + src/test/kotlin/com/nylas/NylasClientTest.kt | 1 + 4 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3e7948f..f71f870a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Nylas Java SDK Changelog +### Unreleased +* Added support for `Accept-Encoding: gzip` in HTTP headers + ### [2.5.0] - Released 2024-09-25 ### Added diff --git a/src/main/kotlin/com/nylas/NylasClient.kt b/src/main/kotlin/com/nylas/NylasClient.kt index b85f7021..1903d59e 100644 --- a/src/main/kotlin/com/nylas/NylasClient.kt +++ b/src/main/kotlin/com/nylas/NylasClient.kt @@ -63,6 +63,7 @@ class NylasClient( ACCEPT("Accept"), AUTHORIZATION("Authorization"), CONTENT_TYPE("Content-Type"), + ACCEPT_ENCODING("Accept-Encoding") } init { diff --git a/src/main/kotlin/com/nylas/interceptors/AddVersionHeadersInterceptor.kt b/src/main/kotlin/com/nylas/interceptors/AddVersionHeadersInterceptor.kt index 54a34cbc..331e2d17 100644 --- a/src/main/kotlin/com/nylas/interceptors/AddVersionHeadersInterceptor.kt +++ b/src/main/kotlin/com/nylas/interceptors/AddVersionHeadersInterceptor.kt @@ -13,6 +13,7 @@ class AddVersionHeadersInterceptor : Interceptor { override fun intercept(chain: Interceptor.Chain): Response { val requestBuilder = chain.request().newBuilder() .header("User-Agent", USER_AGENT) + .header("Accept-Encoding", "gzip") return chain.proceed(requestBuilder.build()) } diff --git a/src/test/kotlin/com/nylas/NylasClientTest.kt b/src/test/kotlin/com/nylas/NylasClientTest.kt index d85b358e..5597fb90 100644 --- a/src/test/kotlin/com/nylas/NylasClientTest.kt +++ b/src/test/kotlin/com/nylas/NylasClientTest.kt @@ -503,6 +503,7 @@ class NylasClientTest { assertEquals("Accept", NylasClient.HttpHeaders.ACCEPT.headerName) assertEquals("Authorization", NylasClient.HttpHeaders.AUTHORIZATION.headerName) assertEquals("Content-Type", NylasClient.HttpHeaders.CONTENT_TYPE.headerName) + assertEquals("Accept-Encoding", NylasClient.HttpHeaders.ACCEPT_ENCODING.headerName) } } }