Skip to content

Commit b5bcb7c

Browse files
authored
Prevent Empty Cookie addition (#2008)
1 parent 2783980 commit b5bcb7c

File tree

1 file changed

+3
-1
lines changed
  • ktor-client/ktor-client-core/common/src/io/ktor/client/features/cookies

1 file changed

+3
-1
lines changed

ktor-client/ktor-client-core/common/src/io/ktor/client/features/cookies/HttpCookies.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ class HttpCookies(
7171
val cookies = feature.get(context.url.clone().build())
7272

7373
with(context) {
74-
headers[HttpHeaders.Cookie] = renderClientCookies(cookies)
74+
if (cookies.isNotEmpty()) {
75+
headers[HttpHeaders.Cookie] = renderClientCookies(cookies)
76+
}
7577
}
7678
}
7779

0 commit comments

Comments
 (0)