Skip to content

Commit 73580df

Browse files
author
Irene Alvarado
committed
Only pass authorization header if value is not undefined
1 parent ff73f51 commit 73580df

7 files changed

Lines changed: 127917 additions & 192155 deletions

File tree

dist/LICENSE

Lines changed: 911 additions & 291 deletions
Large diffs are not rendered by default.

dist/index.js

Lines changed: 126987 additions & 191848 deletions
Large diffs are not rendered by default.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module.exports =
12
/******/ (() => { // webpackBootstrap
23
/******/ "use strict";
34
/******/ var __webpack_modules__ = ({
@@ -1757,9 +1758,8 @@ module.exports = require("util");;
17571758
/******/ // The require function
17581759
/******/ function __nccwpck_require__(moduleId) {
17591760
/******/ // Check if module is in cache
1760-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
1761-
/******/ if (cachedModule !== undefined) {
1762-
/******/ return cachedModule.exports;
1761+
/******/ if(__webpack_module_cache__[moduleId]) {
1762+
/******/ return __webpack_module_cache__[moduleId].exports;
17631763
/******/ }
17641764
/******/ // Create a new module (and put it into the cache)
17651765
/******/ var module = __webpack_module_cache__[moduleId] = {
@@ -1784,13 +1784,10 @@ module.exports = require("util");;
17841784
/************************************************************************/
17851785
/******/ /* webpack/runtime/compat */
17861786
/******/
1787-
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
1788-
/******/
1787+
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
1788+
/******/ // module exports must be returned from runtime so entry inlining is disabled
17891789
/******/ // startup
17901790
/******/ // Load entry module and return exports
1791-
/******/ // This entry module is referenced by other modules so it can't be inlined
1792-
/******/ var __webpack_exports__ = __nccwpck_require__(95);
1793-
/******/ module.exports = __webpack_exports__;
1794-
/******/
1791+
/******/ return __nccwpck_require__(95);
17951792
/******/ })()
17961793
;

dist/sourcemap-register.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/backends/http.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ import axios from 'axios'
55

66
export default async function fetchHTTP(config: HTTPConfig): Promise<string> {
77
core.info('Fetching: HTTP')
8+
9+
// Authorization headers
10+
const auth = {
11+
headers: {
12+
authorization: config.authorization,
13+
}
14+
};
15+
const headers = config.authorization ? auth : {}
16+
core.info(headers.toString());
17+
818
try {
919
const response = await axios.get(config.http_url, {
1020
method: 'get',
1121
responseType: 'stream',
12-
headers: {
13-
authorization: config.authorization,
14-
},
22+
...headers,
1523
})
1624
const filename = config.downloaded_filename
1725
const writer = fs.createWriteStream(filename)
18-
let bytesWritten = 0
1926
response.data.pipe(writer)
2027
await new Promise((resolve, reject) => {
2128
writer.on('finish', resolve)

0 commit comments

Comments
 (0)