-
Notifications
You must be signed in to change notification settings - Fork 0
Feature implementation from commits 9409e4f..a35c5d2 #2
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
base: feature-base-branch-2
Are you sure you want to change the base?
Conversation
* Fix Subdomains offset handling * Update docs, add extra unit-tests * update logic and tests * update logic * fix lint * Update docs and tests * Update ctx.go * update docs * update docs * update docs * add test case for port * Update offset documentation
Bumps [github.com/gofiber/schema](https://github.com/gofiber/schema) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/gofiber/schema/releases) - [Commits](gofiber/schema@v1.4.0...v1.5.0) --- updated-dependencies: - dependency-name: github.com/gofiber/schema dependency-version: 1.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.38.0 to 0.39.0. - [Commits](golang/crypto@v0.38.0...v0.39.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.39.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
chore: fix spelling mistakes across codebase
…lang.org/x/crypto-0.39.0 build(deps): bump golang.org/x/crypto from 0.38.0 to 0.39.0
…thub.com/gofiber/schema-1.5.0 build(deps): bump github.com/gofiber/schema from 1.4.0 to 1.5.0
* remove ExcludeVars option * Simplify envvar export logic
…details and infrastructure considerations (gofiber#3509) * docs: Enhance CORS middleware documentation with preflight request details and infrastructure considerations * docs: Update CORS middleware documentation with infrastructure handling options and best practices * docs: fix CORS middleware documentation markdown linting issues
* Improve CORS middleware * 🐛 fix: Remove unused 'slices' import from CORS middleware --------- Co-authored-by: Jason McNeil <[email protected]>
♻️ refactor: Update loop syntax for retry mechanism
* ✨ feat: Update session middleware add Keys method and update docs to match key type any * ✨ test: Add /keys endpoint to set and retrieve multiple session keys * ✨ test: Refactor /keys endpoint to trim whitespace and improve key handling in session tests
* test: move config tests into earlydata_test * Fix lint issue
* Consolidate idempotency tests * Fix lint issues * Fix more lint issues * Fix lint issue
* test: add HSTS coverage * Update middleware/helmet/helmet_test.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update helmet_test.go * Update helmet_test.go * Revert test changes --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@@ -45,7 +45,7 @@ func (e *ExponentialBackoff) Retry(f func() error) error { | |||
e.currentInterval = e.InitialInterval | |||
} | |||
var err error | |||
for i := 0; i < e.MaxRetryCount; i++ { | |||
for range e.MaxRetryCount { |
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.
🐛 Correctness Issue
Syntax Error: Invalid range expression.
The code uses 'for range e.MaxRetryCount' which is invalid Go syntax as range requires an iterable type (slice, array, map, string, or channel), not an integer.
Current Code (Diff):
- for range e.MaxRetryCount {
+ for i := 0; i < e.MaxRetryCount; i++ {
📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
for range e.MaxRetryCount { | |
for i := 0; i < e.MaxRetryCount; i++ { |
@@ -107,7 +107,7 @@ func Test_ExponentialBackoff_Next(t *testing.T) { | |||
for _, tt := range tests { | |||
t.Run(tt.name, func(t *testing.T) { | |||
t.Parallel() | |||
for i := 0; i < tt.expBackoff.MaxRetryCount; i++ { | |||
for i := range tt.expBackoff.MaxRetryCount { |
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.
🐛 Correctness Issue
Compilation Error: Invalid range expression.
Using range with an integer (MaxRetryCount) will cause a compilation failure as range in Go requires a slice, array, string, map, or channel to iterate over.
Current Code (Diff):
- for i := range tt.expBackoff.MaxRetryCount {
+ for i := 0; i < tt.expBackoff.MaxRetryCount; i++ {
📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
for i := range tt.expBackoff.MaxRetryCount { | |
for i := 0; i < tt.expBackoff.MaxRetryCount; i++ { |
|
||
// Function to set Preflight CORS headers | ||
func setPreflightHeaders(c fiber.Ctx, allowOrigin, maxAge string, cfg Config) { | ||
setSimpleHeaders(c, allowOrigin, cfg) |
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.
🐛 Correctness Issue
Missing required parameter in function call.
The call to setSimpleHeaders is missing the required maxAge parameter which will cause a compilation error.
Current Code (Diff):
- setSimpleHeaders(c, allowOrigin, cfg)
+ setSimpleHeaders(c, allowOrigin, maxAge, cfg)
📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
setSimpleHeaders(c, allowOrigin, cfg) | |
setSimpleHeaders(c, allowOrigin, maxAge, cfg) |
PR Summary
Bug Fixes and Code Quality Improvements
Overview
This PR addresses multiple bugs, improves code quality, and enhances test coverage across various middleware components. It fixes several critical issues in the CORS middleware, improves security in the environment variables middleware, and corrects numerous spelling errors and variable naming conventions throughout the codebase.
Change Types
Affected Modules
cors/cors.go
retry/exponential_backoff.go
envvar/envvar.go
session/middleware.go
binder.go
,mapping.go
ctx.go
listen.go
prefork.go
Breaking Changes
Notes for Reviewers