Skip to content

Comments

feat: Add optional custom headers (GoFeatureFlag)#1465

Merged
thomaspoignant merged 2 commits intoopen-feature:mainfrom
olvlvl:olvlvl-custom-headers
Feb 5, 2026
Merged

feat: Add optional custom headers (GoFeatureFlag)#1465
thomaspoignant merged 2 commits intoopen-feature:mainfrom
olvlvl:olvlvl-custom-headers

Conversation

@olvlvl
Copy link
Contributor

@olvlvl olvlvl commented Feb 4, 2026

This PR

Adds support for custom headers. One could use the feature to define a User-Agent to prevent requests from being blocked by servers that require browser-like identification or specific device signatures.

Notes

Our WAF requires the User-Agent header to be defined. Requests to the relay-proxy are being denied because the header is not specified.

Signed-off-by: Olivier Laviale <olivier.laviale@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @olvlvl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the GoFeatureFlag web provider by adding support for optional custom HTTP headers. This feature addresses common integration challenges, such as bypassing Web Application Firewalls (WAFs) that require specific headers like User-Agent, by allowing developers to configure these headers directly within the provider options. The change improves the provider's compatibility and flexibility across various network environments.

Highlights

  • Custom Headers Support: Introduced a new customHeaders option to the GoFeatureFlagWebProviderOptions interface, allowing users to define arbitrary HTTP headers to be sent with every request.
  • Header Injection Logic: Implemented logic within the GoffApiController to dynamically add the specified custom headers to outgoing HTTP requests, ensuring they are included in API calls.
  • Documentation Update: Updated the README.md to reflect the new customHeaders option, including its type and description, and provided an example of its usage.
  • Unit Test Coverage: Added comprehensive unit tests to goff-api.spec.ts and go-feature-flag-web-provider.spec.ts to verify that custom headers are correctly processed and sent with requests.
Changelog
  • libs/providers/go-feature-flag-web/README.md
    • Added an example of userAgent in the provider instantiation snippet.
    • Included customHeaders in the 'Available options' table with its type and description.
  • libs/providers/go-feature-flag-web/src/lib/controller/goff-api.spec.ts
    • Updated test cases to include customHeaders in GoffApiController options.
    • Added assertions to verify that custom headers, including User-Agent and Authorization, are correctly present in the outgoing request headers.
  • libs/providers/go-feature-flag-web/src/lib/controller/goff-api.ts
    • Modified the collectData method to iterate through and apply customHeaders to the request headers if they are provided in the options.
  • libs/providers/go-feature-flag-web/src/lib/go-feature-flag-web-provider.spec.ts
    • Updated test cases to include customHeaders in GoFeatureFlagWebProvider options.
    • Added an assertion to confirm that the User-Agent custom header is correctly sent with requests.
  • libs/providers/go-feature-flag-web/src/lib/model.ts
    • Added the customHeaders?: Record<string, string>; property to the GoFeatureFlagWebProviderOptions interface, along with its JSDoc comment.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@olvlvl olvlvl marked this pull request as ready for review February 4, 2026 17:02
@olvlvl olvlvl requested review from a team as code owners February 4, 2026 17:02
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for custom headers to the GoFeatureFlag web provider. The changes look good overall, with updates to the provider, API controller, models, and tests to support this new feature. I've added a few comments to improve the documentation and simplify the code for adding custom headers in one of the files.

Signed-off-by: Olivier Laviale <olivier.laviale@gmail.com>
Copy link
Member

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 LGTM

@thomaspoignant thomaspoignant merged commit 23a2363 into open-feature:main Feb 5, 2026
7 checks passed
@olvlvl olvlvl deleted the olvlvl-custom-headers branch February 5, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants