Skip to content

Commit

Permalink
feat(middleware/csrf): Add support for trusted origins (#2910)
Browse files Browse the repository at this point in the history
* feat(middleware/csrf): Add support for trusted origins in CSRF middleware

* fix(middleware/csrf): lint errors

* docs(middleware/csrf): following the ai

* fix(middleware/csrf): isSameSchemeAndDomain

* fix(middleware/csrf): null origin

expand tests to check invalid urls in headers

* chore(middleware/csrf): Sentinel Errors

test(middleware/csrf): improve coverage

* docs: add extra space between sentences.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore(middleware/csrf): remove trailing newline in csrf_test.go

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
sixcolors and coderabbitai[bot] authored Mar 10, 2024
1 parent 7bc43dc commit fcb8537
Show file tree
Hide file tree
Showing 4 changed files with 648 additions and 150 deletions.
Loading

1 comment on commit fcb8537

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: fcb8537 Previous: d2b19e2 Ratio
Benchmark_Etag 199.7 ns/op 0 B/op 0 allocs/op 98.08 ns/op 0 B/op 0 allocs/op 2.04
Benchmark_Middleware_Favicon 208.3 ns/op 12 B/op 4 allocs/op 90.01 ns/op 3 B/op 1 allocs/op 2.31

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.