Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServeDir lacks the Last-Modified response header #411

Open
photino opened this issue Sep 23, 2023 · 3 comments
Open

ServeDir lacks the Last-Modified response header #411

photino opened this issue Sep 23, 2023 · 3 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR.

Comments

@photino
Copy link

photino commented Sep 23, 2023

Bug Report

Version

0.4.4

Platform

64-bit (Windows)

Crates

Description

The ServeDir lacks the Last-Modified response header even when it returns a 304 response.

image

@nathaniel-daniel
Copy link

nathaniel-daniel commented Oct 10, 2023

To my understanding, it isn't strictly required to send a Last-Modified header for 304 responses: https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.5

@photino
Copy link
Author

photino commented Oct 10, 2023

It is also OK to return an ETag header. Without either Last-Modified or ETag, it is difficult for us to ensure that the content is unchanged.

@nathaniel-daniel
Copy link

It is also OK to return an ETag header. Without either Last-Modified or ETag, it is difficult for us to ensure that the content is unchanged.

Well, you would know it's unchanged because of the 304 response. An ETag header seems necessary for 304s, but a Last-Modified isn't. Also note that ServeDir doesn't use ETags at all. It is also explicitly stated that a Last-Modified header may be useful for responses without an ETag, but it isn't required.

I was just trying to note that the current behavior isn't technically wrong, but it might still be worthwhile to send a Last-Modified header for 304 responses.

@jplatte jplatte added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR.
Projects
None yet
Development

No branches or pull requests

3 participants