(t, e = (() => {
}))
| 2280 | } |
| 2281 | |
| 2282 | get(t, e = (() => { |
| 2283 | })) { |
| 2284 | t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {"X-Surge-Skip-Scripting": !1})), $httpClient.get(t, (t, s, i) => { |
| 2285 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 2286 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => { |
| 2287 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 2288 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 2289 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { |
| 2290 | try { |
| 2291 | if (t.headers["set-cookie"]) { |
| 2292 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); |
| 2293 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar |
| 2294 | } |
| 2295 | } catch (t) { |
| 2296 | this.logErr(t) |
| 2297 | } |
| 2298 | }).then(t => { |
| 2299 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 2300 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 2301 | }, t => { |
| 2302 | const {message: s, response: i} = t; |
| 2303 | e(s, i, i && i.body) |
| 2304 | })) |
| 2305 | } |
| 2306 | |
| 2307 | post(t, e = (() => { |
| 2308 | })) { |
no test coverage detected