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

response: add support for ETag option in res.sendFile #6073

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

juanarbol
Copy link
Contributor

This patch introduces the ability to control the ETag generation through the res.sendFile function. Specifically, the ETag option is wired to the application's configuration, allowing it to be enabled or disabled based on the app's settings.

Fixes: #2294

This patch introduces the ability to control the ETag generation
through the `res.sendFile` function. Specifically, the ETag option
is wired to the application's configuration, allowing it to be
enabled or disabled based on the app's settings.

Fixes: expressjs#2294
Signed-off-by: Juan José Arboleda <[email protected]>
@UlisesGascon
Copy link
Member

Can we make a test that ensure the that the Etag option is added by deafult? This will help us to document this change and to avoid regressions in the future.

Currently we don't include etag, so we should consider this as a minor or a major change?

@juanarbol
Copy link
Contributor Author

juanarbol commented Oct 19, 2024

Can we make a test that ensure the that the Etag option is added by deafult? This will help us to document this change and to avoid regressions in the future.

Etag is included by default. In the upper tests, you'll see that validation. See

.expect('ETag', /^(?:W\/)?"[^"]+"$/)

Currently we don't include etag, so we should consider this as a minor or a major change?

We do, for sendFIle, this patch will make express aware that even on sendFile, it should not ignore the Etag disabled.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I think this got lost in the backlog of issues. @UlisesGascon do you still think we need more test coverage with this in there?

If not, can we merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable ETag for res.sendFile()
3 participants