ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
279 stars 173 forks source link

Parse delta (integer) values of rfc5861 cache control headers #121

Closed tanguilp closed 2 years ago

tanguilp commented 2 years ago

rfc5861 defines the following headers:

Currently cow_http_hd:parse_cache_control/1 returns a binary for their value. Their delta values could be parsed like max-age, max-stale, min-fresh and s-maxage (here: https://github.com/ninenines/cowlib/blob/6deddc7d3360aa0f50eb2375cc0226157185c472/src/cow_http_hd.erl#L1170) and returned as integers as well.

essen commented 2 years ago

Yes.

A patch for this would be welcome, assuming there is real world use cases. A quick look shows support for this was added a couple years ago in some browsers.

tanguilp commented 2 years ago

The use-case is that I'm working on an HTTP cache library :)

This would make my life easier, but I can do without it.

(BTW thanks for the great work on these libs!)

tanguilp commented 2 years ago

A quick look shows support for this was added a couple years ago in some browsers.

Also note that:

essen commented 2 years ago

Closing in favor of the PR.