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
Hey, recently I came across an interesting problem.
One of the endpoints in my service needs to return two or more Set-Cookie cookies at the same time.
Currently there is no way to create multiple Set-Cookies at the same time, and any attempt to change the type to an array will raise an error such as: unsupported type in header: []string
I have two suggestions:
Let's add the possibility to apply an array type for the Set-Cookie type header
Allow for passing *http.Cookie (and the array) the same as the request comes with *http.Cookie, this would unify the types coming in and out
Example of how I would see the proposal to be integrated:
typeResponsestruct {
// example param with `header:"Set-Cookie"` as a stringCookiestring`header:"Set-Cookie"`// example param with `header:"Set-Cookie"` as a []stringCookies []string`header:"Set-Cookie"`// example param with `header:"Set-Cookie"` as a *http.CookieCookie*http.Cookie`header:"Set-Cookie"`// example param with `header:"Set-Cookie"` as a []*http.CookieCookies []*http.Cookie`header:"Set-Cookie"`
}
(obviously only one parameter with header:"Set-Cookie", just an example of multiple different types)
The text was updated successfully, but these errors were encountered:
linmeii
changed the title
Proposal: Adding multiple values for Set-Cookie and allow http.Cookie type
Proposal: Adding multiple values for Set-Cookie and allowing *http.Cookie type
Nov 4, 2024
Hey, recently I came across an interesting problem.
One of the endpoints in my service needs to return two or more Set-Cookie cookies at the same time.
Currently there is no way to create multiple Set-Cookies at the same time, and any attempt to change the type to an array will raise an error such as:
unsupported type in header: []string
I have two suggestions:
Example response from documentation
Example request from documentation
Example of how I would see the proposal to be integrated:
(obviously only one parameter with
header:"Set-Cookie"
, just an example of multiple different types)The text was updated successfully, but these errors were encountered: