Skip to content
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

maximumContentLength can do IO #1588

Closed
geekingfrog opened this issue Mar 13, 2019 · 1 comment
Closed

maximumContentLength can do IO #1588

geekingfrog opened this issue Mar 13, 2019 · 1 comment

Comments

@geekingfrog
Copy link
Contributor

The current type signature for maximumContentLength is site -> Maybe (Route site) -> Maybe Word64.
I'd like to have the ability to restrict the content length based on a path parameter of the route, so I would need a db lookup.
For example: /upload/foo -> 2MB max, but /upload/bar -> 10MB max, these mappings are stored in a db.
Is there any workaround I can use for now? Is it something which could be added to the next release?

@snoyberg
Copy link
Member

We had a similar situation with shouldLog in the past, and added a shouldLogIO method to the Yesod type class to address this. I think we could do the same thing in this case. Would you be interested in taking a stab at such a PR?

For comparison, here's the prior art: aa5781d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants