Skip to content

Commit c66afb3

Browse files
authored
Update 10010.js
1 parent 5cb9fde commit c66afb3

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎10010/10010.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,18 @@ function init() {
221221
}
222222
log = (message) => console.log(message)
223223
get = (url, cb) => {
224-
225-
if (url['headers'].hasOwnProperty('Content-Length')) delete url['headers']['Content-Length']
224+
console.log(url)
225+
if (url.hasOwnProperty['headers'] && url['headers'].hasOwnProperty('Content-Length')) delete url['headers']['Content-Length']
226226
if (isSurge()) {
227227
$httpClient.get(url, cb)
228228
}
229229
if (isQuanX()) {
230230
url.method = 'GET'
231231
$task.fetch(url).then((resp) => cb(null, resp, resp.body))
232232
}
233-
console.log(url)
234233
}
235234
post = (url, cb) => {
236-
if (url['headers'].hasOwnProperty('Content-Length')) delete url['headers']['Content-Length']
235+
if (url.hasOwnProperty['headers'] && url['headers'].hasOwnProperty('Content-Length')) delete url['headers']['Content-Length']
237236
if (isSurge()) {
238237
$httpClient.post(url, cb)
239238
}

0 commit comments

Comments
 (0)