GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: explain HTTP writeHead()'s fast path behavior · nodejs/node@8e5104b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • http.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/http.md‎

Copy file name to clipboardExpand all lines: doc/api/http.md
+14Lines changed: 14 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,13 @@ const server = http.createServer((req, res) => {
12711271
});
12721272
```
12731273

1274+
If [`response.writeHead()`][] method is called and this method has not been
1275+
called, it will directly write the supplied header values onto the network
1276+
channel without caching internally, and the [`response.getHeader()`][] on the
1277+
header will not yield the expected result. If progressive population of headers
1278+
is desired with potential future retrieval and modification, use
1279+
[`response.setHeader()`][] instead of [`response.writeHead()`][].
1280+
12741281
### response.setTimeout(msecs[, callback])
12751282
<!-- YAML
12761283
added: v0.9.12
@@ -1438,6 +1445,13 @@ When headers have been set with [`response.setHeader()`][], they will be merged
14381445
with any headers passed to [`response.writeHead()`][], with the headers passed
14391446
to [`response.writeHead()`][] given precedence.
14401447

1448+
If this method is called and [`response.setHeader()`][] has not been called,
1449+
it will directly write the supplied header values onto the network channel
1450+
without caching internally, and the [`response.getHeader()`][] on the header
1451+
will not yield the expected result. If progressive population of headers is
1452+
desired with potential future retrieval and modification, use
1453+
[`response.setHeader()`][] instead.
1454+
14411455
```js
14421456
// returns content-type = text/plain
14431457
const server = http.createServer((req, res) => {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.