mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2024-11-22 03:41:00 -05:00
Update dist
This commit is contained in:
parent
0170dcbc31
commit
88637cb5c4
1 changed files with 11 additions and 1 deletions
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 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' }
|
||||
|
||||
if (!!core.getInput('username')) {
|
||||
|
@ -2615,7 +2625,7 @@ if (!!core.getInput('bearerToken')) {
|
|||
const instance = axios.create({
|
||||
baseURL: core.getInput('url', { required: true }),
|
||||
timeout: parseInt(core.getInput('timeout') || 5000, 10),
|
||||
headers
|
||||
headers: { ...headers, ...customHeaders }
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue