-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept tuple lists in set_resp_headers #1295
Comments
Am I right to assume you meant something like the following? Req = cowboy_req:set_resp_headers([
{<<"content-type">> , <<"text/html">>},
{<<"content-encoding">>, <<"gzip">>}
], Req0). |
Yes. |
Will we still do this merge? What should happen in this scenario? Req = cowboy_req:set_resp_headers([
{<<"set-cookie">> , <<"name=essen">>},
{<<"set-cookie">>, <<"age=28">>}
], Req0). I would say it should call the set_resp_cookie twice. Does it make sense? |
In the case of set-cookie it should not call set_resp_cookie but rather append the cookie to Because there can be duplicates of other headers, the headers should first be processed a little: set-cookie can be handled here, and then duplicate headers must be consolidated ( It probably should not be named |
Got it |
I want to include multiple Link headers in an HTTP response, but it seems that the latest version of Cowboy does not allow returning multiple headers. I understand that this Issue and this Pull Request address this issue. Is there anything blocking the implementation of this feature? Additional note: It is defined that separating values with commas when outputting can achieve the same result as multiple disbursements, so it is possible to avoid the issue using this method. ReferenceThe following mechanism requires adding duplicate headers.
|
Sup @voluntas . No blocker. I just couldn't start working on it. If you want to take a look, go ahead. |
The goal of this ticket is not to add support for multiple of the same header. Hopefully that's not needed; if it is then we'd need to have a separate interface for this. You SHOULD be able to have multiple links in one Link header:
https://datatracker.ietf.org/doc/html/rfc8288#section-3.5 But your Link headers are not including the < > so they might not follow the spec in other ways. |
Note that the draft you linked is outdated. The most recent draft has correct Link headers: https://www.ietf.org/archive/id/draft-ietf-wish-whip-13.html#section-4.4 You should be able to use a single Link header to convey the same information. |
Ah, it seems like I posted an old RFC draft, sorry about that. I understand that one Link header should include multiple links. For now, I'll withdraw this request. Thank you always for your polite response! |
To make it easier to deal with different implementations (like Gun).
#1287 (comment)
The text was updated successfully, but these errors were encountered: