Skip to content
Snippets Groups Projects
Unverified Commit 1786fffa authored by Noah Moss's avatar Noah Moss Committed by GitHub
Browse files

Set `CookieSpecs/STANDARD` on HttpClient for Snowplow (#24579)

* set CookieSpecs/STANDARD on Apache HttpClient for Snowplow

* add a comment in the code pointing to the PR

* set cookie spec via RequestConfig instead
parent 9bd07369
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
[com.snowplowanalytics.snowplow.tracker.events Unstructured Unstructured$Builder]
[com.snowplowanalytics.snowplow.tracker.http ApacheHttpClientAdapter ApacheHttpClientAdapter$Builder]
com.snowplowanalytics.snowplow.tracker.payload.SelfDescribingJson
[org.apache.http.client.config CookieSpecs RequestConfig]
org.apache.http.impl.client.HttpClients
org.apache.http.impl.conn.PoolingHttpClientConnectionManager))
......@@ -80,8 +81,14 @@
(def ^:private emitter
"Returns an instance of a Snowplow emitter"
(let [emitter* (delay
(let [client (-> (HttpClients/custom)
(let [request-config (-> (RequestConfig/custom)
;; Set cookie spec to `STANDARD` to avoid warnings about an invalid cookie
;; header in request response (PR #24579)
(.setCookieSpec CookieSpecs/STANDARD)
(.build))
client (-> (HttpClients/custom)
(.setConnectionManager (PoolingHttpClientConnectionManager.))
(.setDefaultRequestConfig request-config)
(.build))
builder (-> (ApacheHttpClientAdapter/builder)
(.httpClient client)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment