(t, e = (() => {
}))
| 937 | } |
| 938 | |
| 939 | get(t, e = (() => { |
| 940 | })) { |
| 941 | 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, { |
| 942 | "X-Surge-Skip-Scripting": !1 |
| 943 | })), $httpClient.get(t, (t, s, i) => { |
| 944 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 945 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { |
| 946 | hints: !1 |
| 947 | })), $task.fetch(t).then(t => { |
| 948 | const { |
| 949 | statusCode: s, |
| 950 | statusCode: i, |
| 951 | headers: r, |
| 952 | body: o |
| 953 | } = t; |
| 954 | e(null, { |
| 955 | status: s, |
| 956 | statusCode: i, |
| 957 | headers: r, |
| 958 | body: o |
| 959 | }, o) |
| 960 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { |
| 961 | try { |
| 962 | if (t.headers["set-cookie"]) { |
| 963 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); |
| 964 | this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar |
| 965 | } |
| 966 | } catch (t) { |
| 967 | this.logErr(t) |
| 968 | } |
| 969 | }).then(t => { |
| 970 | const { |
| 971 | statusCode: s, |
| 972 | statusCode: i, |
| 973 | headers: r, |
| 974 | body: o |
| 975 | } = t; |
| 976 | e(null, { |
| 977 | status: s, |
| 978 | statusCode: i, |
| 979 | headers: r, |
| 980 | body: o |
| 981 | }, o) |
| 982 | }, t => { |
| 983 | const { |
| 984 | message: s, |
| 985 | response: i |
| 986 | } = t; |
| 987 | e(s, i, i && i.body) |
| 988 | })) |
| 989 | } |
| 990 | |
| 991 | post(t, e = (() => { |
| 992 | })) { |
no test coverage detected