Skip to content

Commit 2c79057

Browse files
committed
added debug info for heroku debugging
1 parent d4b1ff7 commit 2c79057

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Proxy.js

+1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ let Proxy = ({urlModify, httpprefix, serverName, port, cookieDomainRewrite, loca
316316
let fwdStr = req.headers['X-Forwarded-For'] || req.headers['x-forwarded-for']
317317

318318
let {host, httpType} = getHostFromReq(req)
319+
console.log(`httpType:${httpType}, host:${host}`)
319320
if (host.indexOf(serverName) !== -1 || // we cannot request resource from proxy itself
320321
host == '' || host.indexOf('.') === -1 || (fwdStr && fwdStr.split(',').length > 3)) { // too many forwardings
321322
res.status(404).send("{}")

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let cookieDomainRewrite = serverName
99
let proxy = Proxy({ urlModify, httpprefix, serverName, port, cookieDomainRewrite, locationReplaceMap302, regReplaceMap, siteSpecificReplace, pathReplace})
1010

1111
const middle1 = (req, res, next) => {
12-
console.log(`req.url:${req.url}`)
12+
console.log(`==== req.url:${req.url}, req headers:${JSON.stringify(req.headers)}`)
1313
const dirPath = path.join(__dirname, req.url)
1414
if (req.url === '/' || req.url === '/index.html') {
1515
body = fs.readFileSync(path.join(__dirname, './index.html'), encoding = 'utf-8')

0 commit comments

Comments
 (0)