From 6335d0831deab4b406534f9c9ad125901ac92575 Mon Sep 17 00:00:00 2001 From: Honglin Mu Date: Tue, 14 Jan 2020 11:44:13 +0800 Subject: [PATCH] fix: HIT today retrieve error #3713 (#3714) --- lib/routes/universities/hit/today.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/routes/universities/hit/today.js b/lib/routes/universities/hit/today.js index d2aaf42cc4..e4f532f151 100644 --- a/lib/routes/universities/hit/today.js +++ b/lib/routes/universities/hit/today.js @@ -36,9 +36,15 @@ module.exports = async (ctx) => { return Promise.resolve(JSON.parse(cache)); } - const response = await got.get(link); + const response = await got({ + method: 'get', + url: link, + headers: { + Referer: host, + }, + }); - if (response.request.res.connection._host === 'ids.hit.edu.cn') { + if (response.req._headers.host === 'ids.hit.edu.cn') { const single = { pubDate: new Date( link