MCPcopy Create free account
hub / github.com/Toulu-debug/enen / get

Method get

sendNotify.js:1000–1023  ·  view source on GitHub ↗
(t, e = (() => {
    }))

Source from the content-addressed store, hash-verified

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 })) {

Callers 3

goCQhttpFunction · 0.45
BarkNotifyFunction · 0.45
getScriptMethod · 0.45

Calls 7

eFunction · 0.50
isSurgeMethod · 0.45
isLoonMethod · 0.45
isQuanXMethod · 0.45
isNodeMethod · 0.45
initGotEnvMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected