-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multiple set-cookie header support #55
Comments
Apparently the Writing portion works for me because of some change in node 19. I created a test case to demonstrate in #56. In the newer version of node the |
Thanks for pointing this out. I actually didn't realize the HeadersInit accepted that two-dimensional array.. I think for the reading part, it is actually possible to use |
I am not sure which version has the change but the following code:
19.8.1
18.12.1
In newer node version it looks like |
I updated my PR with the append which seems to resolve the issue on the latest version of node. I also added more tests for passing in It looks like there is a new method |
I updated the PR again which is tested in I was not able to add any tests for |
Here is the
|
PR is now merged and will be part of the 2.2.0 release! |
@ikreymer Thank you! |
The library at the moment does not fully support writing or reading multiple set-cookie responses set in some warc files. I am partially able to workaround the issue when writing, but blocked by the current implementation of the reader.
Writing
By setting
keepHeadersCase: false
it forcesWarcRecord
to use the nativenew Headers(httpHeaders)
class as seen on this line.By passing in a two-dimensional array as documented and seen here:
I can successfully get Warc Record to write multiple headers:
Reading
Because StatusAndHeaders reads the buffer line by line and uses
.set
, it doesn't support multiple set-cookie without creating a comma separated list as seen here.This is how deno solved a similar issue. I also found this issue at warcio that suggests they support multiple
set-cookie
headers.Perhaps we should buffer to array of key, values like warcio before passing it to the class and "it should work"?
I can do some work on this, but wanted to confirm the direction.
The text was updated successfully, but these errors were encountered: