Skip to content

Drakma hides non-conforming HTTP 204 with content from the user #154

@phoe

Description

@phoe

https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5

drakma/request.lisp

Lines 888 to 893 in 18b6ace

((not (or (eq method :head)
(= status-code 204)))
(let (trailers)
(multiple-value-setq (body trailers)
(read-body http-stream headers external-format-body
:decode-content decode-content))

I was bitten by it when our server sent a malformed HTTP 204 containing a body (see edicl/hunchentoot#247). Drakma (used in our tests) nonetheless reported the body as NIL, therefore causing a test to wrongly succeed. A workaround was to :want-stream t and then read from it ourselves.

Should this be a WONTFIX (the response is technically non-conforming), or is this something that should be changed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions