(hints)
| 935 | } |
| 936 | |
| 937 | writeEarlyHints(hints) { |
| 938 | validateObject(hints, 'hints'); |
| 939 | |
| 940 | const headers = { __proto__: null }; |
| 941 | |
| 942 | const linkHeaderValue = validateLinkHeaderValue(hints.link); |
| 943 | |
| 944 | for (const key of ObjectKeys(hints)) { |
| 945 | if (key !== 'link') { |
| 946 | const name = key.trim().toLowerCase(); |
| 947 | assertValidHeader(name, hints[key]); |
| 948 | if (!checkIsHttpToken(name)) |
| 949 | throw new ERR_INVALID_HTTP_TOKEN('Header name', name); |
| 950 | headers[name] = hints[key]; |
| 951 | } |
| 952 | } |
| 953 | |
| 954 | if (linkHeaderValue.length === 0) { |
| 955 | return false; |
| 956 | } |
| 957 | |
| 958 | headers.Link = linkHeaderValue; |
| 959 | |
| 960 | return this.writeInformation(HTTP_STATUS_EARLY_HINTS, headers); |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | function onServerStream(ServerRequest, ServerResponse, |
no test coverage detected