Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/angular_devkit/core/src/json/schema/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
import * as ajv from 'ajv';
import * as http from 'http';
import * as https from 'https';
import { Observable, from, isObservable, of, throwError } from 'rxjs';
import { concatMap, map, switchMap, tap } from 'rxjs/operators';
import * as Url from 'url';
Expand Down Expand Up @@ -144,7 +145,9 @@ export class CoreSchemaRegistry implements SchemaRegistry {

// If none are found, handle using http client.
return new Promise<JsonObject>((resolve, reject) => {
http.get(uri, res => {
const url = new Url.URL(uri);
const client = url.protocol === 'https:' ? https : http;
client.get(url, res => {
if (!res.statusCode || res.statusCode >= 300) {
// Consume the rest of the data to free memory.
res.resume();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('CoreSchemaRegistry', () => {
},
},
tslint: {
$ref: 'http://json.schemastore.org/tslint#',
$ref: 'https://json.schemastore.org/tslint#',
},
},
})
Expand Down