| 998 | } |
| 999 | |
| 1000 | get(t, e = (() => { |
| 1001 | })) { |
| 1002 | 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) => { |
| 1003 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 1004 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => { |
| 1005 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1006 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1007 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { |
| 1008 | try { |
| 1009 | if (t.headers["set-cookie"]) { |
| 1010 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); |
| 1011 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar |
| 1012 | } |
| 1013 | } catch (t) { |
| 1014 | this.logErr(t) |
| 1015 | } |
| 1016 | }).then(t => { |
| 1017 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1018 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1019 | }, t => { |
| 1020 | const {message: s, response: i} = t; |
| 1021 | e(s, i, i && i.body) |
| 1022 | })) |
| 1023 | } |
| 1024 | |
| 1025 | post(t, e = (() => { |
| 1026 | })) { |