Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
refactor(deps): use helix-fetch@v2
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Feb 1, 2021
1 parent a97cc3f commit ac80e8a
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 14 deletions.
65 changes: 61 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@adobe/fastly-native-promises": "1.19.6",
"@adobe/helix-epsagon": "1.5.6",
"@adobe/helix-fetch": "1.9.2",
"@adobe/helix-fetch": "2.1.0",
"@adobe/helix-shared": "7.19.2",
"@adobe/helix-status": "9.0.0",
"@adobe/openwhisk-action-logger": "2.3.1",
Expand Down
11 changes: 7 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ const { wrap: status } = require('@adobe/helix-status');
const { epsagon } = require('@adobe/helix-epsagon');
const Fastly = require('@adobe/fastly-native-promises');
const { utils } = require('@adobe/helix-shared');
const { fetch } = require('@adobe/helix-fetch').context({
httpsProtocols:
const fetchAPI = require('@adobe/helix-fetch');

const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1
/* istanbul ignore next */
process.env.HELIX_FETCH_FORCE_HTTP1 ? ['http1'] : ['http2', 'http1'],
});
? fetchAPI.context({
alpnProtocols: [fetchAPI.ALPN_HTTP1_1],
})
: fetchAPI;
const commence = require('./stop');

async function purgeInner(host, path, service, token, log) {
Expand Down
12 changes: 7 additions & 5 deletions src/stop.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
* governing permissions and limitations under the License.
*/
const { equal } = require('assert');
const { fetch } = require('@adobe/helix-fetch').context({
maxCacheSize: 0,
httpsProtocols:
const fetchAPI = require('@adobe/helix-fetch');

const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1
/* istanbul ignore next */
process.env.HELIX_FETCH_FORCE_HTTP1 ? ['http1'] : ['http2', 'http1'],
});
? fetchAPI.context({
alpnProtocols: [fetchAPI.ALPN_HTTP1_1],
})
: fetchAPI;

async function commence(log) {
try {
Expand Down

0 comments on commit ac80e8a

Please sign in to comment.