contrib/gofiber/fiber: upgrade to v2.50.0 and fix breaking change #2277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
gofiber/fiber
to v2.50.0gofiber/fiber
is upgradedUnfortunately, I couldn't find a good way to unit test this. Mostly, I want to make sure that
h.Add(k, v)
in line 57 is used, since it allows for appending multiple headers with the same value, instead ofh.Set(k, v)
, which would overwrite the values incorrectly. This shouldn't be all that essential though, since these headers are only used to extract the span context of the parent, which doesn't rely on headers that need multiple values (e.g. uses trace-id headers).The only way I could see to test this would be to break out the creation of the
http.Header{}
type into a helper method, and doing a small unit test on the helper method. I haven't done that at this point, but I'd like reviewer feedback on whether there is a better way to test that, or if they feel that unit test would be helpful. But again, I'm not sure it's worth it.Fixes #2275
Motivation
There was a critical security fix that was released in
gofiber/fiber
, which we should upgrade to. Unfortunately, the release with the security fix also included a breaking change toGetReqHeaders()
by changing the return type. Our code needed to be changed to avoid compilation issues when users upgrade.See https://github.com/gofiber/fiber/releases/tag/v2.50.0 for more details.
Reviewer's Checklist
For Datadog employees:
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!