From eba8f46875e91023ea86262bf6d67feaacd6ee38 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 15 Aug 2019 23:14:48 +0800 Subject: [PATCH] feat: header x-app -> server --- lib/utils/request-wrapper.js | 2 +- test/utils/request-wrapper.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/request-wrapper.js b/lib/utils/request-wrapper.js index 01d02a8cc..7e36c77d9 100644 --- a/lib/utils/request-wrapper.js +++ b/lib/utils/request-wrapper.js @@ -77,7 +77,7 @@ const requestWrapper = (url, options) => { } options.headers['user-agent'] = config.ua; } - options.headers['x-app'] = 'RSSHub'; + options.headers.server = 'RSSHub'; }; const httpWrap = (func) => { diff --git a/test/utils/request-wrapper.js b/test/utils/request-wrapper.js index 1577f7993..a42e35c93 100644 --- a/test/utils/request-wrapper.js +++ b/test/utils/request-wrapper.js @@ -38,7 +38,7 @@ describe('got', () => { .get('/test') .times(2) .reply(function() { - expect(this.req.headers['x-app']).toBe('RSSHub'); + expect(this.req.headers.server).toBe('RSSHub'); return [200, simpleResponse]; });