Skip to content

fix(csrf): update middleware usage to comply with gorilla/csrf changes#4262

Merged
erka merged 2 commits into
v2from
rd/v2/csrf-update
May 29, 2025
Merged

fix(csrf): update middleware usage to comply with gorilla/csrf changes#4262
erka merged 2 commits into
v2from
rd/v2/csrf-update

Conversation

@erka

@erka erka commented May 29, 2025

Copy link
Copy Markdown
Contributor

In v1.7.3, gorilla/csrf introduced a requirement to explicitly provide information about the request protocol (HTTP or HTTPS).
This PR updates the middleware configuration to comply with the new API and ensure CSRF protection continues to work in secure and non-secure environments.

@codecov

codecov Bot commented May 29, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (v2@a437e5f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/cmd/http.go 0.00% 4 Missing ⚠️
cmd/flipt/config.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #4262   +/-   ##
=====================================
  Coverage      ?   50.93%           
=====================================
  Files         ?      122           
  Lines         ?    13127           
  Branches      ?        0           
=====================================
  Hits          ?     6686           
  Misses        ?     5877           
  Partials      ?      564           
Flag Coverage Δ
unittests 50.93% <70.58%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erka
erka marked this pull request as ready for review May 29, 2025 14:54
@erka
erka requested a review from a team as a code owner May 29, 2025 14:54
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 29, 2025

@markphelps markphelps left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice!

@erka
erka merged commit 79c34c0 into v2 May 29, 2025
@erka
erka deleted the rd/v2/csrf-update branch May 29, 2025 20:36
@erka erka added the v2 Flipt v2 label May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files. v2 Flipt v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants