etag.calculate always returns weak
I'm passing in a string, which should, according to the readme, calculate a strong etag and setting weak to false
await etag.calculate(myString, { weak: false })
Result is still a weak ETag prefixed with W/, what am I doing wrong?
Feels a little like the nullish coalescing isn't doing its job 🤔
https://github.com/oakserver/oak/blob/9ce772628961a8a1edec92b3c5d62d09f5d7c7f4/etag.ts#L110
@CanRau I don't think it's that. The comments say that the "weak" options overrides the default behavior. Look a couple lines down. https://github.com/oakserver/oak/blob/9ce772628961a8a1edec92b3c5d62d09f5d7c7f4/etag.ts#L115
I had the same problem as you when I wrote my http sever.
I print etag.calculate return value. It indeed is strong etag. But I still get weak etag in browser response.
Until I saw this. https://deno.land/manual/runtime/http_server_apis#what-happens-to-an-etag-header
I suggest you use weak etag or skip deno automatic compression.
Thanks for the insides, and yeah I probably misinterpreted the code there, also thanks for the links 🙏
Closing as everything seems to be fine and I'm currently not working with Oak so 😥😅