mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2025-06-06 14:47:57 +08:00
Update dist
This commit is contained in:
parent
0170dcbc31
commit
88637cb5c4
12
dist/index.js
vendored
12
dist/index.js
vendored
@ -2598,6 +2598,16 @@ const core = __webpack_require__(470);
|
|||||||
const axios = __webpack_require__(53);
|
const axios = __webpack_require__(53);
|
||||||
|
|
||||||
const auth = {}
|
const auth = {}
|
||||||
|
let customHeaders = {}
|
||||||
|
|
||||||
|
if (!!core.getInput('customHeaders')) {
|
||||||
|
try {
|
||||||
|
customHeaders = JSON.parse(core.getInput('customHeaders'));
|
||||||
|
} catch(error) {
|
||||||
|
core.error('Could not parse customHeaders string value')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const headers = { 'Content-Type': core.getInput('contentType') || 'application/json' }
|
const headers = { 'Content-Type': core.getInput('contentType') || 'application/json' }
|
||||||
|
|
||||||
if (!!core.getInput('username')) {
|
if (!!core.getInput('username')) {
|
||||||
@ -2615,7 +2625,7 @@ if (!!core.getInput('bearerToken')) {
|
|||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
baseURL: core.getInput('url', { required: true }),
|
baseURL: core.getInput('url', { required: true }),
|
||||||
timeout: parseInt(core.getInput('timeout') || 5000, 10),
|
timeout: parseInt(core.getInput('timeout') || 5000, 10),
|
||||||
headers
|
headers: { ...headers, ...customHeaders }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user