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

Returning alternate status (such as 401) does not use the layout #92

Open
LeviSchuck opened this issue May 16, 2021 · 0 comments
Open

Comments

@LeviSchuck
Copy link

At present if I return

{:status 401 :body [:h1 "no can do"]}

from a handler, it fails during the middleware stuff where it's trying to merge things.

To get around this, I had to make my own function that evaluates the layout manually.

(defn not-authorized [request body]
  (merge
    (template/app-layout {:request request :body body})
    @{
    :status 401
    }))

I think it's safe to say that if the body is a list and not bytes?, and there's no content type header, that the layout middleware can be used.

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

1 participant