Skip to content

Commit

Permalink
fixed forum.iask.ca login issue
Browse files Browse the repository at this point in the history
  • Loading branch information
netptop committed Feb 29, 2020
1 parent a272dfa commit f64c7b1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ let Proxy = ({httpprefix, serverName, port, cookieDomainRewrite, locationReplace
let myRe
let {host, httpType} = getHostFromReq(req)
let location = res.getHeaders()['location']
if (res.statusCode == '301' || res.statusCode == '302' || res.statusCode == '307' || res.statusCode == '308') {
if (res.statusCode == '301' || res.statusCode == '302' || res.statusCode == '303' ||res.statusCode == '307' || res.statusCode == '308') {
location = locationReplaceMap302({location, serverName, httpprefix, host, httpType})
logSave(`after replacement, location=${location}`)
res.setHeader('location', location)
Expand Down Expand Up @@ -151,7 +151,7 @@ let Proxy = ({httpprefix, serverName, port, cookieDomainRewrite, locationReplace
onError: (err, req, res) => {
console.log(`onerror: ${err}`)
try {
res.status(404).send(`onError: ${err}`)
// res.status(404).send(`onError: ${err}`)
} catch(e) {
console.log(`error of sending 404: ${e}`)
}
Expand Down Expand Up @@ -231,8 +231,7 @@ let Proxy = ({httpprefix, serverName, port, cookieDomainRewrite, locationReplace
.map(cookie => {
logSave(`cookie:${JSON.stringify(cookie)}`)
if (cookie.path && cookie.path[0] === '/') {
cookie.domain = `127.0.0.1`
cookie.path = `${req.url}`
cookie.domain = `${serverName}`
}
cookie.secure = false
return cookie
Expand Down

0 comments on commit f64c7b1

Please sign in to comment.