Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(middleware/cors): Validation of multiple Origins (#2883)
* fix: allow origins check Refactor CORS origin validation and normalization to trim leading or trailing whitespace in the cfg.AllowOrigins string [list]. URLs with whitespace inside the URL are invalid, so the normalizeOrigin will return false because url.Parse will fail, and the middleware will panic. fixes #2882 * test: AllowOrigins with whitespace * test(middleware/cors): add benchmarks * chore: fix linter errors * test(middleware/cors): use h() instead of app.Test() * test(middleware/cors): add miltiple origins in Test_CORS_AllowOriginScheme * chore: refactor validate and normalize * test(cors/middleware): add more benchmarks (cherry picked from commit d456e7d)
- Loading branch information
4ab8629
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.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.Benchmark_Middleware_Favicon
207.2
ns/op 12 B/op 4 allocs/op90.43
ns/op 3 B/op 1 allocs/op2.29
This comment was automatically generated by workflow using github-action-benchmark.