mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 04:11:26 +08:00
feat: replace baseUrl to prefixUrl when got's next version (#2996)
* enhance: replace baseUrl to prefixUrl when got's next version * test: baseUrl
This commit is contained in:
@@ -40,6 +40,9 @@ const custom = got.extend({
|
|||||||
if (options.query) {
|
if (options.query) {
|
||||||
options.searchParams = options.query; // for Got v11 after
|
options.searchParams = options.query; // for Got v11 after
|
||||||
}
|
}
|
||||||
|
if (options.baseUrl) {
|
||||||
|
options.prefixUrl = options.baseUrl; // for Got next version
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ describe('got', () => {
|
|||||||
return [200, '{"code": 0}'];
|
return [200, '{"code": 0}'];
|
||||||
});
|
});
|
||||||
|
|
||||||
const response1 = await got.post('http://rsshub.test/post', {
|
const response1 = await got.post('post', {
|
||||||
|
baseUrl: 'http://rsshub.test/',
|
||||||
form: true,
|
form: true,
|
||||||
data: {
|
data: {
|
||||||
test: 1,
|
test: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user