mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
fix(core/utils): invalid request header Server (#9582)
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
@@ -102,9 +102,6 @@ const requestWrapper = (url, options) => {
|
|||||||
options.headers['user-agent'] = config.ua;
|
options.headers['user-agent'] = config.ua;
|
||||||
}
|
}
|
||||||
|
|
||||||
// server
|
|
||||||
options.headers.server = 'RSSHub';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const urlHandler = new URL(url);
|
const urlHandler = new URL(url);
|
||||||
// referer
|
// referer
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ describe('got', () => {
|
|||||||
.get(/.*/)
|
.get(/.*/)
|
||||||
.times(3)
|
.times(3)
|
||||||
.reply(function () {
|
.reply(function () {
|
||||||
expect(this.req.headers.server).toBe('RSSHub');
|
|
||||||
expect(this.req.headers.referer).toBe('http://api.rsshub.test');
|
expect(this.req.headers.referer).toBe('http://api.rsshub.test');
|
||||||
expect(this.req.headers.host).toBe('api.rsshub.test');
|
expect(this.req.headers.host).toBe('api.rsshub.test');
|
||||||
return [200, simpleResponse];
|
return [200, simpleResponse];
|
||||||
|
|||||||
Reference in New Issue
Block a user