weavejester / compojure

A concise routing library for Ring/Clojure
Eclipse Public License 1.0
4.08k stars 259 forks source link

HEAD requests assume the response is a `clojure.lang.Associative` #181

Closed richardcordova closed 6 years ago

richardcordova commented 6 years ago

Most of the routing logic is agnostic as to the form of the response. This has allowed me to pass around a channel as the response, which works well in almost all cases.

HEAD requests are an exception to this as seen in https://github.com/weavejester/compojure/blob/master/src/compojure/core.clj#L33

Could this restriction be relaxed while preserving the existing semantics?

weavejester commented 6 years ago

Adding a restriction like that would limit future functionality. Why not wrap the channel in a map and use compojure.response/Renderable to add the wrapper automatically?

richardcordova commented 6 years ago

Thanks, that seems to work. Good to have it confirmed that it needs to be map.