Skip to content

HTTPNotModified 304 must have no body  #442

Closed
@PolarNick239

Description

In the following code:

response = web.HTTPNotModified(headers={'ETag': etag})

reponse will be constructed with body = b'304: Not Modified'
But empty body expected.

RFC:

... it responds with a special status code (usually, 304 (Not Modified)) and no entity-body ...

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3

Workaround:

response = web.HTTPNotModified(headers={'ETag': etag}, body=b'')

For example QT client with small probability on such responses raises exception, that connection was closed. :(

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions