Authored by 周少峰

Merge branch 'hotfix/pass-ip' into gray

... ... @@ -150,4 +150,6 @@ library
### foreman ###
Procfile
.env
.package-lock
yarn.lock
package-json.lock
... ...
... ... @@ -49,7 +49,15 @@ const generate = (req, res, next) => {
res.type('png');
if (result.code === 200) {
request(result.data.url).pipe(res);
request({
url: result.data.url,
headers: {
'X-request-ID': req.reqID || '',
'X-YOHO-IP': req.yoho.clientIp || '',
'X-Forwarded-For': req.yoho.clientIp || '',
'User-Agent': 'yoho/nodejs'
}
}).pipe(res);
}
}).catch(next);
... ...