nginx / nginx/njs

Add possibility to send early hints headers

Open
#896 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature njs
Dominant language
C
Stars
1.6k
Forks
239
Avg merge
2d 9h
Merged PRs (30d)
10

Description

It would be a great thing to be able to send HTTP 103 headers aka early hints using njs, actually, tryed using

r.headersOut['Link'] = '</style.css>; rel=preload; as=style';
r.headersOut['Link'] = '</script.js>; rel=preload; as=script';

r.return(103, "");

in js_content or when setting a variable with js_var...

but got error curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)

makes sens, so needs internal support for this?

regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining how response headers are handled from js_content and when setting a variable with js_var., including r.headersOut and the attempted HTTP 103 response. Determine the internal support needed for early hints so the HTTP/2 request completes without a PROTOCOL_ERROR; done means njs can send HTTP 103 headers correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, javascript, nginx
Domain
backend, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.