@microsoft/kiota-abstractions
Advanced tools
Comparing version 1.0.0-preview.50 to 1.0.0-preview.51
@@ -25,3 +25,4 @@ /** Maintains a list of valid hosts and allows authentication providers to check whether a host is valid before authenticating a request */ | ||
private isHostAndPathValid; | ||
private validateHosts; | ||
} | ||
//# sourceMappingURL=allowedHostsValidator.d.ts.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
constructor(allowedHosts = new Set()) { | ||
this.validateHosts(allowedHosts); | ||
this.allowedHosts = allowedHosts !== null && allowedHosts !== void 0 ? allowedHosts : new Set(); | ||
@@ -26,2 +27,3 @@ } | ||
setAllowedHosts(allowedHosts) { | ||
this.validateHosts(allowedHosts); | ||
this.allowedHosts = allowedHosts; | ||
@@ -68,4 +70,14 @@ } | ||
} | ||
validateHosts(hostsToValidate) { | ||
if (!hostsToValidate) { | ||
throw new Error("hostsToValidate cannot be null"); | ||
} | ||
hostsToValidate.forEach(host => { | ||
if (host.toLowerCase().startsWith("http://") || host.toLowerCase().startsWith("https://")) { | ||
throw new Error("host should not contain http or https prefix"); | ||
} | ||
}); | ||
} | ||
} | ||
exports.AllowedHostsValidator = AllowedHostsValidator; | ||
//# sourceMappingURL=allowedHostsValidator.js.map |
@@ -25,3 +25,4 @@ /** Maintains a list of valid hosts and allows authentication providers to check whether a host is valid before authenticating a request */ | ||
private isHostAndPathValid; | ||
private validateHosts; | ||
} | ||
//# sourceMappingURL=allowedHostsValidator.d.ts.map |
@@ -8,2 +8,3 @@ /** Maintains a list of valid hosts and allows authentication providers to check whether a host is valid before authenticating a request */ | ||
constructor(allowedHosts = new Set()) { | ||
this.validateHosts(allowedHosts); | ||
this.allowedHosts = allowedHosts !== null && allowedHosts !== void 0 ? allowedHosts : new Set(); | ||
@@ -23,2 +24,3 @@ } | ||
setAllowedHosts(allowedHosts) { | ||
this.validateHosts(allowedHosts); | ||
this.allowedHosts = allowedHosts; | ||
@@ -65,3 +67,13 @@ } | ||
} | ||
validateHosts(hostsToValidate) { | ||
if (!hostsToValidate) { | ||
throw new Error("hostsToValidate cannot be null"); | ||
} | ||
hostsToValidate.forEach(host => { | ||
if (host.toLowerCase().startsWith("http://") || host.toLowerCase().startsWith("https://")) { | ||
throw new Error("host should not contain http or https prefix"); | ||
} | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=allowedHostsValidator.js.map |
{ | ||
"name": "@microsoft/kiota-abstractions", | ||
"version": "1.0.0-preview.50", | ||
"version": "1.0.0-preview.51", | ||
"description": "Core abstractions for kiota generated libraries in TypeScript and JavaScript", | ||
@@ -38,3 +38,3 @@ "main": "dist/cjs/src/index.js", | ||
"@opentelemetry/api": "^1.7.0", | ||
"@std-uritemplate/std-uritemplate": "^0.0.55", | ||
"@std-uritemplate/std-uritemplate": "^0.0.57", | ||
"guid-typescript": "^1.0.9", | ||
@@ -48,3 +48,3 @@ "tinyduration": "^3.3.0", | ||
}, | ||
"gitHead": "e991da0d0539f786bfc7ff21b9d07e1e46642d58" | ||
"gitHead": "8b6e35c21fdd163b9412bbb7e7fcdf11d475eaab" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
708779
8125
+ Added@std-uritemplate/std-uritemplate@0.0.57(transitive)
- Removed@std-uritemplate/std-uritemplate@0.0.55(transitive)