MCPcopy Index your code
hub / github.com/scality/cloudserver / buildRequest

Function buildRequest

tests/unit/api/corsErrorHeaders.js:94–109  ·  view source on GitHub ↗
(spec)

Source from the content-addressed store, hash-verified

92}
93
94function buildRequest(spec) {
95 // DummyRequest is an http.IncomingMessage stream that emits 'end'
96 // synchronously. We need that because callApiMethod's waterfall
97 // waits for the request body on non-objectPut paths.
98 return new DummyRequest({
99 bucketName,
100 objectKey: spec.objectKey,
101 headers: {
102 host: `${bucketName}.s3.amazonaws.com`,
103 origin,
104 },
105 url: spec.url,
106 query: spec.query,
107 method: spec.httpMethod,
108 }, Buffer.alloc(0));
109}
110
111function buildResponseSpy(sandbox) {
112 const headers = {};

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected