Skip to content

Commit

Permalink
Remove cache / cc user agent headers (#47)
Browse files Browse the repository at this point in the history
* Remove cache / cc user agent headers

* Update ConfigFetcher.ts
  • Loading branch information
z4kn4fein authored Jun 2, 2022
1 parent 8f0700d commit cb10157
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "configcat-js-ssr",
"version": "5.4.0",
"version": "5.5.0",
"description": "ConfigCat Feature Flags for Server Side Rendered apps like NuxtJS. Official ConfigCat SDK for Server Side Rendered to easily access feature flags.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"axios": "^0.27.2",
"configcat-common": "^5.3.0"
"configcat-common": "^6.0.0"
},
"devDependencies": {
"@types/chai": "^4.2.4",
Expand Down
8 changes: 2 additions & 6 deletions src/ConfigFetcher.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { IConfigFetcher, ProjectConfig, OptionsBase, FetchResult } from "configcat-common";
import { IConfigFetcher, OptionsBase, FetchResult } from "configcat-common";
import axios, { AxiosRequestConfig } from 'axios';


export class HttpConfigFetcher implements IConfigFetcher {

fetchLogic(options: OptionsBase, lastEtag: string, callback: (result: FetchResult) => void): void {
fetchLogic(options: OptionsBase, _lastEtag: string, callback: (result: FetchResult) => void): void {

const axiosConfig: AxiosRequestConfig = {
method: 'get',
timeout: options.requestTimeoutMs,
url: options.getUrl(),
headers: {
'X-ConfigCat-UserAgent': options.clientVersion,
'If-None-Match': (lastEtag) ? lastEtag : null
}
};

axios(axiosConfig)
Expand Down

0 comments on commit cb10157

Please sign in to comment.