adapter-netlify: Support multiValueHeaders
key in returned object from handler function
#1741
Labels
multiValueHeaders
key in returned object from handler function
#1741
Is your feature request related to a problem? Please describe.
Netlify Functions allow a
multiValueHeaders
key in the returned object of the handler function. This key is specifically made for array values.For example, as the Svelte-kit docs say, in order to set multiple cookies in a response, you can do the following in an endpoint:
However, this fails when deployed to Netlify. In order to set multiple cookies in a Netlify function, you have to do this:
This is documented here: https://docs.netlify.com/functions/build-with-javascript/#synchronous-function-format.
Describe the solution you'd like
A way to set multiple cookies with the Netlify adapter, ideally keeping the same API as described above. The adapter should check for array values in the rendered headers object and transfer them in a
multiValueHeaders
key in the returned response.Describe alternatives you've considered
There isn't really any alternatives to this, as the only way to set multiple cookies in a response with Netlify functions is through this key.
How important is this feature to you?
Very! Setting multiple cookies is supposed to be a supported feature in Svelte-kit. Also, most auth systems are going to be able to do this.
The text was updated successfully, but these errors were encountered: