Skip to content

Commit

Permalink
[Gitar] Cleaning up stale feature flag: stripClientHeadersOn304 with …
Browse files Browse the repository at this point in the history
…value true (#6868)

<details>
  <summary>Feature Flag Cleanup</summary>

  | Stale Flag |  Value  |
  | ---------- | ------- |
  |   stripClientHeadersOn304   | true |

  </details>

  <details>
  <summary>Trigger</summary>

  #6559 (comment)

  </details>

  <details>
  <summary>Bot Commands</summary>

`@gitar-bot cleanup stale_flag=value` will cleanup a stale feature flag.
Replace `stale_flag` with the name of the stale feature flag and `value`
with either `true` or `false`.

  </details>

---------

Co-authored-by: Gitar Bot <noreply@gitar.co>
  • Loading branch information
gitar-bot[bot] and Gitar Bot committed Apr 16, 2024
1 parent 279d343 commit 8dbd680
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ exports[`should create default config 1`] = `
"showInactiveUsers": false,
"signals": false,
"strictSchemaValidation": false,
"stripClientHeadersOn304": false,
"useMemoizedActiveTokens": false,
"userAccessUIEnabled": false,
"variantDependencies": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,7 @@ export default class FeatureController extends Controller {

if (etag === userVersion) {
res.status(304);
if (this.flagResolver.isEnabled('stripClientHeadersOn304')) {
res.getHeaderNames().forEach((header) =>
res.removeHeader(header),
);
}
res.getHeaderNames().forEach((header) => res.removeHeader(header));
res.end();
return;
} else {
Expand Down
8 changes: 3 additions & 5 deletions src/lib/features/metrics/instance/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@ export default class ClientMetricsController extends Controller {
);

await this.metricsV2.registerClientMetrics(data, clientIp);
if (this.flagResolver.isEnabled('stripClientHeadersOn304')) {
res.getHeaderNames().forEach((header) =>
res.removeHeader(header),
);
}
res.getHeaderNames().forEach((header) =>
res.removeHeader(header),
);
res.status(202).end();
} catch (e) {
res.status(400).end();
Expand Down
6 changes: 0 additions & 6 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export type IFlagKey =
| 'advancedPlayground'
| 'filterInvalidClientMetrics'
| 'disableMetrics'
| 'stripClientHeadersOn304'
| 'stripHeadersOnAPI'
| 'signals'
| 'automatedActions'
Expand Down Expand Up @@ -133,11 +132,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_DISABLE_METRICS,
false,
),
stripClientHeadersOn304: parseEnvVarBoolean(
process.env
.UNLEASH_EXPERIMENTAL_DETECT_SEGMENT_USAGE_IN_CHANGE_REQUESTS,
false,
),
signals: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_SIGNALS,
false,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ process.nextTick(async () => {
embedProxyFrontend: true,
anonymiseEventLog: false,
responseTimeWithAppNameKillSwitch: false,
stripClientHeadersOn304: true,
stripHeadersOnAPI: true,
celebrateUnleash: true,
featureSearchFeedbackPosting: true,
Expand Down

0 comments on commit 8dbd680

Please sign in to comment.