solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

Append http headers instead of overwrite

Open samcfinan opened this issue 3 years ago • 3 comments

This implementation appends headers instead of overwrites if a header with the same name is set.

I'm considering a change to the API where overwrite: true could be passed if we want to force overwriting.

Would love to get some eyes on this.

samcfinan avatar Aug 08 '22 01:08 samcfinan

I think these APIs follow the pattern of our @solidjs/meta components, i.e they should overwrite by default, and have an API with append: true for appending since that's the unusual behaviour with the header instead of the default behaviour when you assign a header.

So

<HttpHeader name="x" value="y" /> = responseHeaders.set(x, y) <HttpHeader name="x" value="y" append /> = responseHeaders.append(x, y) (we need to think about clean up here)

nksaraf avatar Aug 08 '22 03:08 nksaraf

Updated!

samcfinan avatar Aug 08 '22 14:08 samcfinan

Do you think we can handle the cleanup side of this as well.. checkout the onCleanup function below the code you edited where we cleanup set headers. Could you handle append headers there too?

nksaraf avatar Aug 11 '22 21:08 nksaraf

Thanks

ryansolid avatar Jan 29 '23 09:01 ryansolid