Closed leoliu closed 5 years ago
The accept_ranges
header is not documented as a header that Yaws treats specially, so you must specify it as a string, not an atom:
{header, {"Accept-Ranges", "bytes"}}
See the yaws_api(5) man page or the yaws pdf documentation, section 7.6 for a list of headers for which Yaws allows atom names.
accept_ranges
appears in #headers
but not #outh
in yaws.hrl
.
Correct, which is why it'll work fine if you specify it as a string. And even if I add it to #outh
, specifying it as a string will still work.
But it is a bit confusing though where you can specify the atom accept_range
when reading but not when writing the header.
Thanks, @vinoski.
Hi @vinoski
I just discovered something unusual after the change. The following no longer outputs the accept-ranges
header. But if I revert to 576ba9c5dd7233ee061a85245475c90edf332378
it works again.
{page, {[{header, {"Accept-Ranges", <<"bytes">>}}], Page}}
Thanks, this was my mistake. Fixed on master now, and with a new unit test.
Thanks for the fix.
Returning
{header, {accept_ranges, "bytes"}}
fromout/1
causes a crash: