-
Notifications
You must be signed in to change notification settings - Fork 133
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
Optional validation of header contents #385
Comments
Hi, if I understand correctly addressing this would require these steps:
It would also be possible to let the user decide what characters to accept, e.g. by adding a Before writing the necessary code I'd like to hear your opinions :) |
Instead of my original suggestion, we could also implement the whole validation logic as a WAI middleware |
So basically we replace the
by
? I can make a PR for that. |
@fumieval you would prefer a WAI middleware I believe? I can implement this but I would prefer to have your go-ahead Personally I think putting this in |
@pbrinkmeier I believe the middleware approach makes implementation much easier. I don't have a strong opinion about the user-facing API, but how about adding |
@fumieval but then, why use a flag at all when the user can just insert a middleware? |
@ocramz I'd personally prefer letting users insert the middleware, but I thought it might be an option if we care about ease of use. |
Okay, so should we add the middleware to |
+1 to exporting the middleware from Web.Scotty (IMO the right place for this middleware is https://hackage.haskell.org/package/wai-extra, but it shouldn't stop going forward in scotty) |
While implementing this I noticed that Edit: At that point I could also move the PR to |
I just added a PR at |
The PR in |
Originally posted by @fumieval in #359 (comment)
Reference: #92
The text was updated successfully, but these errors were encountered: