-
Notifications
You must be signed in to change notification settings - Fork 541
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
The type of set-cookies obtained by heaers is inconsistent with the actual type? #1892
Labels
bug
Something isn't working
Comments
pan93412
added a commit
to pan93412/undici
that referenced
this issue
Jan 28, 2023
Currently `headers["set-cookie"]` does not split, which can't match the expected type of IncomingHttpHeader. This commit attempts to split `headers["set-cookie"]` by `;` like what 'node:http' does: https://nodejs.org/api/http.html#class-httpserverresponse Fixed nodejs#1892
pan93412
added a commit
to pan93412/undici
that referenced
this issue
Jan 28, 2023
Currently `headers["set-cookie"]` does not split, which can't match the expected type of IncomingHttpHeader. This commit attempts to split `headers["set-cookie"]` by `;` like what 'node:http' does: https://nodejs.org/api/http.html#class-httpserverresponse Fixed nodejs#1892 Signed-off-by: pan93412 <pan93412@gmail.com>
7 tasks
pan93412
added a commit
to pan93412/undici
that referenced
this issue
Jan 29, 2023
According to core/util@parseHeaders, the current behavior is: - By default, the entry type is a `string`. - The entry type turns to a `string[]` when there are duplicated entries This behavior is not as same as what `node:http` does currently; therefore, `IncomingHttpHeaders` can't reflect our parsed data. This commit attempts to reflect this parsing behavior. Fixed nodejs#1892 Signed-off-by: pan93412 <pan93412@gmail.com>
7 tasks
pan93412
added a commit
to pan93412/undici
that referenced
this issue
Jan 29, 2023
According to core/util@parseHeaders, the current behavior is: - By default, the entry type is a `string`. - The type turns to a `string[]` when there are duplicated entries. This behavior is not as same as what `node:http` does currently; therefore, `IncomingHttpHeaders` can't reflect our parsed data. This commit attempts to reflect this parsing behavior by redefining it to `Record<string, string | string[]>`. Fixed nodejs#1892 The simpler solution of nodejs#1893 Signed-off-by: pan93412 <pan93412@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
headers["set-cookie"]
returned is a string, type declaration is astring [] | undefined
?Reproducible By
Expected Behavior
Logs & Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: