-
Notifications
You must be signed in to change notification settings - Fork 260
Common Problems
Danny Purcell edited this page Jan 2, 2014
·
4 revisions
This page lists some pitfalls that may not be obvious to users. Feel free to add your own!
- In a request, the value for
:body
is anInputStream
. InputStream is mutable and can only ever be read once. Anything that tries to read theInputStream
after it has already been read will fail to do so. If you find the value for:body
empty when it shouldn't be, the most likely cause is some other middleware higher in the stack reading theInputStream
before it gets to you.- Ex: If you have two sets of routes in the same stack each using the
wrap-params
middleware. Only the first routes would have the params.
- Ex: If you have two sets of routes in the same stack each using the
- Compojure does not yet automatically redirect requests for URIs with trailing slashes to handlers matching non-trailing-slash routes. For now, consider using a middleware function to chomp the slash from the end of the URI or to call a handler which redirects to the proper route.