custom ETag function isn't working for SendFile
- Dominant language
- JavaScript
- Stars
- 69.5k
- Forks
- 25k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
I set the custom function according to the http://expressjs.com/en/api.html#etag.options.table
```
app.set('etag', function (body, encoding) {
return generateHash(body, encoding) // consider the function is defined
})
```
Despite on that it's not working and the best way I could influence etag value is to call
sendFile with etag : true or false but this just turns on and off the standard etag (also not documented) , not the custom one.
https://github.com/expressjs/express/issues/2294
https://github.com/expressjs/express/issues/2129
My use case is that I want to track responses of specific files. So I wanted to make a "strong hash" that I can be 100% sure would unambiguously represent the file.
Contributor guide
Assessment
This issue has not been assessed yet.