(t, e = (() => {
}))
| 1147 | } |
| 1148 | |
| 1149 | get(t, e = (() => { |
| 1150 | })) { |
| 1151 | 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) => { |
| 1152 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 1153 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => { |
| 1154 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1155 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1156 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { |
| 1157 | try { |
| 1158 | if (t.headers["set-cookie"]) { |
| 1159 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); |
| 1160 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar |
| 1161 | } |
| 1162 | } catch (t) { |
| 1163 | this.logErr(t) |
| 1164 | } |
| 1165 | }).then(t => { |
| 1166 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1167 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1168 | }, t => { |
| 1169 | const {message: s, response: i} = t; |
| 1170 | e(s, i, i && i.body) |
| 1171 | })) |
| 1172 | } |
| 1173 | |
| 1174 | post(t, e = (() => { |
| 1175 | })) { |
no test coverage detected