Skip to content

Commit

Permalink
fix: use https at all times (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber authored Nov 20, 2020
1 parent 49fd1ca commit cd969d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/systemjs-unpkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
try {
return resolve.apply(this, arguments);
} catch (error) {
id = '//unpkg.com/' + id;
id = 'https://unpkg.com/' + id;
try {
return resolve.call(this, id, parentUrl);
} catch (_) {
Expand Down
6 changes: 3 additions & 3 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('should resolve module on UNPKG', async () => {
require('../src/systemjs-unpkg'); // eslint-disable-line import/no-unassigned-import

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

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

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

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

spy.mockRestore();
});
Expand Down

0 comments on commit cd969d9

Please sign in to comment.