Closed Elknar closed 6 years ago
I was thinking the same thing, it doesn't look like nil vs empty string has any obvious effect on the response, I get content-length: 0 for both. I suggest we just pick one.
Ring uses empty strings here: https://github.com/ring-clojure/ring/blob/736394806167cb2af87716655f73da9f8fbd0226/ring-core/src/ring/util/response.clj#L20-L36
Empty string is used for responses which will never have a body, i.e. non-entity response types like informational (100-199) or redirection (300-399). This is to match to the linked Ring redirect
and redirect-after-post
functions.
Awesome, thanks for the info
On Tue, Mar 20, 2018, 08:53 Juho Teperi notifications@github.com wrote:
Empty string is used for responses which will never have a body, i.e. non-entity response types like informational (100-199) or redirection (300-399). This is to match to the linked Ring redirect and redirect-after-post functions.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/metosin/ring-http-response/issues/19#issuecomment-374627161, or mute the thread https://github.com/notifications/unsubscribe-auth/AD2siGKLEi6_iKNQAWBHk7CESkVOPFrVks5tgRffgaJpZM4QGcU6 .
Some responses default to a
nil
body, while others use an empty string.For example, compare
ok
andno-content
.