-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
🐛 [Bug]: CSRF middleware default ContextKey and PassLocalsToViews #2682
Comments
@sixcolors can you help here |
@ly020044 I am looking into this now. It doesn't cause errors with any other supported fiber template engine. |
gofiber/template/django/v3 will pass keys to Pongo2 that do not meet the regex in The regex is: var reIdentifiers = regexp.MustCompile("^[a-zA-Z0-9_]+$") I have created a PR that will exclude any KVP that has an "invalid identifier". Fixed in gofiber/template#307 |
I have submitted a proposal related to this issue: #2684 |
Bug Description
I'm using csrf middleware with v2.49.2 is worked. But after upgrade to v2.50.0, Errors will occur when visit any page.
failed to render: [Error (where: checkForValidIdentifiers)] context-key 'fiber.csrf.handler' (value: '&{config:0x14001198a00 sessionManager:<nil> storageManager:0x14000842e80}') is not a valid identifier
If change csrf config
HandlerContextKey="csrf"
, is worked. BecauseHandlerContextKey
is default valuefiber.csrf.handle
, So the default value contains the.
character..xx
is usually used in templates to access properties or methods.How to Reproduce
Steps to reproduce the behavior:
PassLocalsToViews: true
django
html engine.Expected Behavior
Can visit all pages.
Fiber Version
v2.50.0
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: