Skip to content

Commit

Permalink
test: make CoreSchemaRegistry test green again
Browse files Browse the repository at this point in the history
`http://json.schemastore.org/tslint` has moved permanently to `https://json.schemastore.org/tslint` which is causing this test to fail
  • Loading branch information
alan-agius4 committed May 27, 2020
1 parent ebd5cbc commit b908a07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit b908a07

Please sign in to comment.