Skip to content

Commit

Permalink
active patch for migu download url nondanee#380
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed Feb 4, 2020
1 parent 1031243 commit 3cf327a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ hook.request.before = ctx => {

hook.request.after = ctx => {
const {req, proxyRes, netease, package} = ctx
if (req.headers.host === 'tyst.migu.cn' && proxyRes.headers['content-range'] && proxyRes.statusCode === 200) proxyRes.statusCode = 206
if (netease && hook.target.path.includes(netease.path) && proxyRes.statusCode == 200) {
return request.read(proxyRes, true)
.then(buffer => buffer.length ? proxyRes.body = buffer : Promise.reject())
Expand Down Expand Up @@ -306,6 +307,8 @@ const tryMatch = ctx => {
const os = header.os || cookie.os, version = header.appver || cookie.appver
if (os in limit && newer(limit[os], version))
return cache(computeHash, task, 7 * 24 * 60 * 60 * 1000).then(value => item.md5 = value)

console.log('skip', os, version)
}
catch(e) {}
})
Expand Down

0 comments on commit 3cf327a

Please sign in to comment.