MCPcopy
hub / github.com/webpack/webpack-dev-server / request

Function request

test/e2e/cross-origin-request.test.js:238–251  ·  view source on GitHub ↗
(url, headers = {})

Source from the content-addressed store, hash-verified

236 });
237
238 function request(url, headers = {}) {
239 return new Promise((resolve, reject) => {
240 const req = http.get(url, { headers }, (res) => {
241 let body = "";
242 res.on("data", (chunk) => {
243 body += chunk;
244 });
245 res.on("end", () => {
246 resolve({ status: res.statusCode, headers: res.headers, body });
247 });
248 });
249 req.on("error", reject);
250 });
251 }
252
253 it("should set Cross-Origin-Resource-Policy: same-origin by default", async () => {
254 const compiler = webpack(config);

Callers 6

bundle.test.jsFile · 0.85
headers.test.jsFile · 0.85
server.test.jsFile · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…