MCPcopy
hub / github.com/dougmoscrop/serverless-http / writeHead

Method writeHead

lib/response.js:65–81  ·  view source on GitHub ↗
(statusCode, reason, obj)

Source from the content-addressed store, hash-verified

63 }
64
65 writeHead(statusCode, reason, obj) {
66 const headers = typeof reason === 'string'
67 ? obj
68 : reason
69
70 for (const name in headers) {
71 this.setHeader(name, headers[name])
72
73 if (!this._wroteHeader) {
74 // we only need to initiate super.headers once
75 // writeHead will add the other headers itself
76 break
77 }
78 }
79
80 super.writeHead(statusCode, reason, obj);
81 }
82
83 constructor({ method }) {
84 super({ method });

Callers 3

generic.jsFile · 0.80
node.jsFile · 0.80
spec.jsFile · 0.80

Calls 1

setHeaderMethod · 0.95

Tested by

no test coverage detected