| 1740 | } |
| 1741 | |
| 1742 | get(t, e = (() => { |
| 1743 | })) { |
| 1744 | 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) => { |
| 1745 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 1746 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => { |
| 1747 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1748 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1749 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { |
| 1750 | try { |
| 1751 | if (t.headers["set-cookie"]) { |
| 1752 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); |
| 1753 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar |
| 1754 | } |
| 1755 | } catch (t) { |
| 1756 | this.logErr(t) |
| 1757 | } |
| 1758 | }).then(t => { |
| 1759 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1760 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1761 | }, t => { |
| 1762 | const {message: s, response: i} = t; |
| 1763 | e(s, i, i && i.body) |
| 1764 | })) |
| 1765 | } |
| 1766 | |
| 1767 | post(t, e = (() => { |
| 1768 | })) { |