Closed leoliu closed 6 years ago
Do you have an example?
For example to send two Link headers to clisock:
Link: </main.css>; rel=preload; as=style
Link: </main.js>; rel=preload; as=script
test() ->
H = yaws_api:set_header(#headers{}, "Link", {multi, ["</main.css>; rel=preload; as=style", "</main.js>; rel=preload; as=script"]}),
yaws_api:reformat_header(H).
;; returns
[["Link: </main.css>; rel=preload; as=style",
"Link: </main.js>; rel=preload; as=script"]]
If a header has multiple values
{multi, Values}
the return value is no longer a simple [ Header1, Header2 .....] but a list that is a nightmare to join with\r\n
before sending back to the client.