| 287 | } |
| 288 | |
| 289 | get(t, e = (() => { |
| 290 | })) { |
| 291 | 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) => { |
| 292 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 293 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => { |
| 294 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 295 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 296 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { |
| 297 | try { |
| 298 | if (t.headers["set-cookie"]) { |
| 299 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); |
| 300 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar |
| 301 | } |
| 302 | } catch (t) { |
| 303 | this.logErr(t) |
| 304 | } |
| 305 | }).then(t => { |
| 306 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 307 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 308 | }, t => { |
| 309 | const {message: s, response: i} = t; |
| 310 | e(s, i, i && i.body) |
| 311 | })) |
| 312 | } |
| 313 | |
| 314 | post(t, e = (() => { |
| 315 | })) { |