Skip to content

Commit

Permalink
index.html updates; return directly for 404 without waiting for html …
Browse files Browse the repository at this point in the history
…body
  • Loading branch information
netptop committed Mar 15, 2020
1 parent 8b53120 commit bb2f472
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,14 @@ let Proxy = ({urlModify, httpprefix, serverName, port, cookieDomainRewrite, loca
});
res.statusCode = proxyRes.statusCode
logSave(`res.status:${res.statusCode} res.url:${res.url}, res.headers:${JSON.stringify(res.getHeaders())}`)
if (res.statusCode === 404) {
try {
res.status(404).send("")
} catch(e) {
logSave(`error: ${e}`)
}
return
}
},
onProxyReq: (proxyReq, req, res) => {
let myRe = new RegExp(`/${httpprefix}/${serverName}.*?/`, 'g') // match group
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<input class="lead-title button1" type="button" onclick="window.location.href='/https/www.6parknews.com'" value="留园网"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/www.mitbbs.com/'" value="未名空间"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/http/www.iask.ca/index.html'" value="加拿大家园网"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/pincong.rocks'" value="品葱"/>
</form>
</kiv>
<div class="container-width">
Expand Down

0 comments on commit bb2f472

Please sign in to comment.