Skip to content

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

@LeviSchuck

Description

@LeviSchuck

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions