Skip to content

Commit 4d43ddf

Browse files
Use HTTPS.
1 parent 2c3f50e commit 4d43ddf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ class Ajv extends AjvCore {
3030
: draft4MetaSchema
3131
this.addMetaSchema(metaSchema, META_SCHEMA_ID, false)
3232
this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID
33+
34+
// Add a copy of the schema for HTTPS references:
35+
const httpsId = META_SCHEMA_ID.replace(/^http:/, "https:")
36+
const httpsSchema = JSON.parse(JSON.stringify(metaSchema)) as AnySchemaObject
37+
httpsSchema.id = httpsSchema.$schema = httpsId + "#"
38+
this.addMetaSchema(httpsSchema, httpsId, false)
3339
}
3440

3541
defaultMeta(): string | AnySchemaObject | undefined {

0 commit comments

Comments
 (0)