You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we can say it's a best practice to use SFV for headers, not JSON in any headers.
For avoiding developer using JSON or any other format, or SFV like format via hand-made-string-concat, Hono can natively support SFV encoder/decoder and guide developer to use it.
for example.
c.res.headers.append('Cache-Status','OriginCache; hit; ttl=1100, "CDN Company Here"; hit; ttl=545')
can be type gurded, by require SFList for value when key is Cache-Status.
It's very interesting, and your library seems very good. If we implement it, we will add the feature to c.header(). I'll try to investigate the SFV more. Thanks.
What is the feature you are proposing?
Structured Field Values is the standard spec for serialize structured object into http header value.
It already referrered by tons of newly defined http specs.
And also, IETF HTTP Working Group currently working on retrofit SFV with existing headers.
So we can say it's a best practice to use SFV for headers, not JSON in any headers.
For avoiding developer using JSON or any other format, or SFV like format via hand-made-string-concat, Hono can natively support SFV encoder/decoder and guide developer to use it.
for example.
can be type gurded, by require SFList for value when key is
Cache-Status
.FYI: I published typed SFV library to npm https://github.com/jxck/structured-field-values
Thanks.
The text was updated successfully, but these errors were encountered: