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

geekingfrog opened this Issue Mar 13, 2019 · 1 comment


None yet
2 participants
Copy link

geekingfrog commented Mar 13, 2019

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?


This comment has been minimized.

Copy link

snoyberg commented Mar 14, 2019

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

@geekingfrog geekingfrog referenced this issue Mar 15, 2019


maximumContentLengthIO #1589

4 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.