Skip to content

Commit 65d23c3

Browse files
committed
Review changes
Signed-off-by: Olivier Laviale <olivier.laviale@gmail.com>
1 parent 52b5f95 commit 65d23c3

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

libs/providers/go-feature-flag-web/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const evaluationCtx: EvaluationContext = {
2929

3030
const goFeatureFlagWebProvider = new GoFeatureFlagWebProvider({
3131
endpoint: endpoint,
32-
userAgent: "my-app/1.0.0",
32+
customHeadeers: {
33+
'User-Agent': "my-app/1.0.0",
34+
},
3335
// ...
3436
}, logger);
3537

@@ -50,15 +52,15 @@ client.addHandler(ProviderEvents.ConfigurationChanged, () => { //... });
5052
```
5153
5254
### Available options
53-
| Option name | Type | Default | Description |
54-
|-------------------------------|------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
55-
| endpoint | string | | endpoint is the URL where your GO Feature Flag server is located. |
56-
| apiTimeout | number | 0 = no timeout | (optional) timeout is the time in millisecond we wait for an answer from the server. |
57-
| apiKey | string | | (optional) If GO Feature Flag is configured to authenticate the requests, you should provide an API Key to the provider. Please ask the administrator of the relay proxy to provide an API Key. |
58-
| customHeaders | <string, string> | | (optional) custom headers to be sent for every HTTP request. |
59-
| websocketRetryInitialDelay | number | 100 | (optional) initial delay in millisecond to wait before retrying to connect the websocket |
60-
| websocketRetryDelayMultiplier | number | 2 | (optional) multiplier of websocketRetryInitialDelay after each failure _(example: 1st connection retry will be after 100ms, second after 200ms, third after 400ms ...)_ |
61-
| websocketMaxRetries | number | 10 | (optional) maximum number of retries before considering the websocket unreachable |
55+
| Option name | Type | Default | Description |
56+
|-------------------------------|--------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
57+
| endpoint | string | | endpoint is the URL where your GO Feature Flag server is located. |
58+
| apiTimeout | number | 0 = no timeout | (optional) timeout is the time in millisecond we wait for an answer from the server. |
59+
| apiKey | string | | (optional) If GO Feature Flag is configured to authenticate the requests, you should provide an API Key to the provider. Please ask the administrator of the relay proxy to provide an API Key. |
60+
| customHeaders | object | | (optional) custom headers to be sent for every HTTP request. |
61+
| websocketRetryInitialDelay | number | 100 | (optional) initial delay in millisecond to wait before retrying to connect the websocket |
62+
| websocketRetryDelayMultiplier | number | 2 | (optional) multiplier of websocketRetryInitialDelay after each failure _(example: 1st connection retry will be after 100ms, second after 200ms, third after 400ms ...)_ |
63+
| websocketMaxRetries | number | 10 | (optional) maximum number of retries before considering the websocket unreachable |
6264
6365
### Reconnection
6466
If the connection to the GO Feature Flag instance fails, the provider will attempt to reconnect with an exponential back-off.

libs/providers/go-feature-flag-web/src/lib/controller/goff-api.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ export class GoffApiController {
4343
};
4444

4545
if (this.options.customHeaders) {
46-
for (const key in this.options.customHeaders) {
47-
if (Object.prototype.hasOwnProperty.call(this.options.customHeaders, key)) {
48-
headers[key] = this.options.customHeaders[key];
49-
}
50-
}
46+
Object.assign(headers, this.options.customHeaders);
5147
}
5248

5349
if (this.options.apiKey) {

0 commit comments

Comments
 (0)