Skip to content
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

http: make early hints implementation more generic #44816

Closed
mcollina opened this issue Sep 29, 2022 · 3 comments · Fixed by #44820
Closed

http: make early hints implementation more generic #44816

mcollina opened this issue Sep 29, 2022 · 3 comments · Fixed by #44820
Labels
good first issue Issues that are suitable for first-time contributors. http Issues or PRs related to the http subsystem.

Comments

@mcollina
Copy link
Member

In #44180, we thought that the "early hints" implementation is not complete as it landed.

We need to fix it either as:

response.writeEarlyHints({
  link: 'your link header',
  x-trace-id: 'id for diagnostics'
})

or

response.writeInfomation(103, "Early Hints", {
  link: 'your link header',
  x-trace-id: 'id for diagnostics'
})
@mcollina mcollina added http Issues or PRs related to the http subsystem. good first issue Issues that are suitable for first-time contributors. labels Sep 29, 2022
@anonrig
Copy link
Member

anonrig commented Sep 29, 2022

I'm working on this task, and will open a pull request soon.

@anonrig
Copy link
Member

anonrig commented Sep 29, 2022

Can a link header be a string and an array just like the parameter type of response.writeEarlyHints?

For example should both of them be valid?

response.writeEarlyHints({
  link: ['</styles.css>; rel=preload; as=style']
})
response.writeEarlyHints({
  link: '</styles.css>; rel=preload; as=style'
})

@mcollina
Copy link
Member Author

Yes

nodejs-github-bot pushed a commit that referenced this issue Oct 6, 2022
PR-URL: #44820
Fixes: #44816
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
danielleadams pushed a commit that referenced this issue Oct 11, 2022
PR-URL: #44820
Fixes: #44816
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are suitable for first-time contributors. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants