Skip to content

Commit cd969d9

Browse files
fix: use https at all times (#3)
1 parent 49fd1ca commit cd969d9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/systemjs-unpkg.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
try {
88
return resolve.apply(this, arguments);
99
} catch (error) {
10-
id = '//unpkg.com/' + id;
10+
id = 'https://unpkg.com/' + id;
1111
try {
1212
return resolve.call(this, id, parentUrl);
1313
} catch (_) {

test/index.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('should resolve module on UNPKG', async () => {
88
require('../src/systemjs-unpkg'); // eslint-disable-line import/no-unassigned-import
99

1010
await System.import('lodash');
11-
expect(spy).toHaveBeenNthCalledWith(2, '//unpkg.com/lodash', undefined);
11+
expect(spy).toHaveBeenNthCalledWith(2, 'https://unpkg.com/lodash', undefined);
1212

1313
spy.mockRestore();
1414
});
@@ -20,7 +20,7 @@ test('should resolve versioned module on UNPKG', async () => {
2020
require('../src/systemjs-unpkg'); // eslint-disable-line import/no-unassigned-import
2121

2222
const _ = await System.import('lodash@4.17.0');
23-
expect(spy).toHaveBeenNthCalledWith(2, '//unpkg.com/lodash@4.17.0', undefined);
23+
expect(spy).toHaveBeenNthCalledWith(2, 'https://unpkg.com/lodash@4.17.0', undefined);
2424
expect(_.VERSION).toBe('4.17.0');
2525
spy.mockRestore();
2626
});
@@ -35,7 +35,7 @@ test('should fail when resolving non-existing module', async () => {
3535
System.import(nonExistentPkg),
3636
).rejects.toThrow('404 Not Found');
3737

38-
expect(spy).toHaveBeenNthCalledWith(2, '//unpkg.com/' + nonExistentPkg, undefined);
38+
expect(spy).toHaveBeenNthCalledWith(2, 'https://unpkg.com/' + nonExistentPkg, undefined);
3939

4040
spy.mockRestore();
4141
});

0 commit comments

Comments
 (0)