actix-web/actix-files
Maximilian Mader f1c3fc4867
`actix-files` Do not send a message body in the NOT_MODIFIED case
As per RFC7230 section 3.3.2 <https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2>:

> A server MAY send a Content-Length header field in a 304 (Not
> Modified) response to a conditional GET request (Section 4.1 of
> [RFC7232]);
> a server MUST NOT send Content-Length in such a response
> unless its field-value equals the decimal number of octets that would
> have been sent in the payload body of a 200 (OK) response to the same
> request.

And per RFC7232 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7232#section-4.1>:

> A 304 response cannot contain a message-body; it is always terminated
> by the first empty line after the header fields.

Previously a `Content-Length: 0` header was sent because `.finish()`
sets the body to `Body::Empty`, which indicates a zero-sized response.
2021-08-01 21:03:11 +02:00
..
src `actix-files` Do not send a message body in the NOT_MODIFIED case 2021-08-01 21:03:11 +02:00
tests add files preference for utf8 text responses (#1714) 2020-10-06 21:56:28 +01:00
CHANGES.md improve docs for Files::new 2020-11-24 20:23:09 +00:00
Cargo.toml prepare actix-files release 0.4.1 2020-11-24 20:33:23 +00:00
LICENSE-APACHE add license files 2019-06-01 17:25:29 +06:00
LICENSE-MIT add license files 2019-06-01 17:25:29 +06:00
README.md prepare actix-files release 0.4.1 2020-11-24 20:33:23 +00:00

README.md

actix-files

Static file serving for Actix Web

crates.io Documentation Version License
dependency status Download Join the chat at https://gitter.im/actix/actix

Documentation & Resources