aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/https.ts
blob: d75fb3132ea7b93f5184bf8f68a7214a96c97213 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Hardcoded module "node:https"
const http = require("node:http");

function request(input, options, cb) {
  if (input && typeof input === "object" && !(input instanceof URL)) {
    input.protocol ??= "https:";
  } else if (typeof options === "object") {
    options.protocol ??= "https:";
  }

  return http.request(input, options, cb);
}

function get(input, options, cb) {
  const req = request(input, options, cb);
  req.end();
  return req;
}

export default {
  ...http,
  get,
  request,
};
sg191/bun/commit/src/javascript/jsc/node/node_fs.zig?h=dylan/github-api-option&id=b8263d097527efb64119a86b82c1e9dcabf40273&follow=1'>s/Buffer/TypedArrayGravatar Jarred Sumner 1-17/+17 2022-04-02Fix mmap on macOS x64Gravatar Jarred Sumner 2-29/+27