-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(relayproxy): allow disable VersionHeader middleware #3141
feat(relayproxy): allow disable VersionHeader middleware #3141
Conversation
✅ Deploy Preview for go-feature-flag-doc-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3141 +/- ##
==========================================
+ Coverage 84.81% 84.86% +0.04%
==========================================
Files 113 113
Lines 5250 5265 +15
==========================================
+ Hits 4453 4468 +15
Misses 632 632
Partials 165 165 ☔ View full report in Codecov by Sentry. |
@thomaspoignant weird for codecov. I added two test on Any idea on how to solve this ? edit: The server do not expose anything to unit test middleware registering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for your PR.
Considering that the default behavior is to have the middleware activated I would suggest to name the config property DisableVersionHeader
instead and also I would try to stick to the common way practice of having Skipper
in the middleware instead of a if around, which can allow to activate the middleware on certain patterns.
Also we will nee to update the documentation to mention this new option in this documentation file.
cmd/relayproxy/config/config.go
Outdated
@@ -262,6 +263,10 @@ type Config struct { | |||
// Version is the version of the relay-proxy | |||
Version string `mapstructure:"version" koanf:"version"` | |||
|
|||
// Enable x-gofeatureflag-version header in the relay-proxy HTTP response | |||
// Default: true | |||
EnableVersionHeader bool `mapstructure:"enableVersionHeader" koanf:"enableversionheader"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤓 nitpick: Since the default behavior is to have the header enabled, I'll suggest to name this new option VersionHeaderDisable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following other property disableNotifierOnInit
, and your first comment #3141 (review) I renamed it DisableVersionHeader
add a boolean EnableVersionHeader in configuration to conditionnally register the VersionHeader custom middleware and disable the header x-gofeatureflag-version issue: thomaspoignant#3140
add a boolean DisableVersionHeader in configuration with Skipper on the VersionHeader middleware to issue: thomaspoignant#3140
51d2592
to
f438cd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomflenner Thanks a lot for this addition 🙏
I have updated slightly the PR to be more idiomatic.
I will merge the PR as soon as the CI pass.
Signed-off-by: Thomas Poignant <[email protected]>
523268e
to
31b99c1
Compare
|
add a boolean EnableVersionHeader in configuration to conditionnally register the VersionHeader custom middleware and disable the header x-gofeatureflag-version
issue: #3140
Description
Add a new boolean named
EnableVersionHeader
in documentation with default value set totrue
in order to not change initial behavior.The idea behind this is to allow end user to disable
VersionHeader
custom middleware to removex-gofeatureflag-version
header.Closes issue(s)
Resolve #3140
Checklist
README.md
and/website/docs
)