Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Jun 8, 2022
1 parent 2418e6b commit 98a2a4a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ApiClient(String appId, String apiKey, String clientName, String version,
this.algoliaAgent.addSegment(segment);
}
}
resetUserAgent();
refreshUserAgent();

addDefaultHeader("X-Algolia-Application-Id", appId);
addDefaultHeader("X-Algolia-API-Key", apiKey);
Expand All @@ -55,7 +55,7 @@ public ApiClient(String appId, String apiKey, String clientName, String version,
}
}

private void resetUserAgent() {
private void refreshUserAgent() {
addDefaultHeader("User-Agent", this.algoliaAgent.toString());
}

Expand All @@ -67,7 +67,7 @@ private void resetUserAgent() {
*/
public ApiClient addAlgoliaAgent(AlgoliaAgent.Segment segment) {
algoliaAgent.addSegment(segment);
resetUserAgent();
refreshUserAgent();
return this;
}

Expand All @@ -79,7 +79,7 @@ public ApiClient addAlgoliaAgent(AlgoliaAgent.Segment segment) {
*/
public ApiClient removeAlgoliaAgent(AlgoliaAgent.Segment segment) {
algoliaAgent.removeSegment(segment);
resetUserAgent();
refreshUserAgent();
return this;
}

Expand Down

0 comments on commit 98a2a4a

Please sign in to comment.