@forge/egress
Advanced tools
Comparing version 1.0.1-next.0 to 1.1.0-next.1
# @forge/egress | ||
## 1.1.0-next.1 | ||
### Minor Changes | ||
- 174deac: Add support for browser environments | ||
## 1.0.1-next.0 | ||
### Patch Changes | ||
- 3c0ac54: Move egress related services out of @forge/csp into new @forge/egress package |
@@ -9,9 +9,7 @@ "use strict"; | ||
constructor(allowList) { | ||
this.URLs = allowList | ||
.filter((domainOrURL) => !domainOrURL.startsWith('*')) | ||
.map((url) => this.safeURL(url)); | ||
this.URLs = allowList.filter((domainOrURL) => !domainOrURL.startsWith('*')).map((url) => this.safeURL(url)); | ||
this.wildcardDomains = allowList | ||
.filter((domainOrURL) => domainOrURL !== '*') | ||
.map((url) => this.safeURL(url)) | ||
.filter((url) => url.hostname.startsWith('*')); | ||
.filter((url) => decodeURIComponent(url.hostname).startsWith('*')); | ||
this.allowsEverything = allowList.includes('*'); | ||
@@ -21,3 +19,4 @@ } | ||
const protocolRegex = /^(.*:\/\/)/; | ||
return new url_1.URL(protocolRegex.test(url) ? url : `${defaultProtocol}${url}`); | ||
const urlParser = url_1.URL !== null && url_1.URL !== void 0 ? url_1.URL : window.URL; | ||
return new urlParser(protocolRegex.test(url) ? url : `${defaultProtocol}${url}`); | ||
} | ||
@@ -33,3 +32,3 @@ isValidUrl(url) { | ||
.filter((allowed) => allowed.protocol === domain.protocol) | ||
.map((url) => url.hostname); | ||
.map((url) => decodeURIComponent(url.hostname)); | ||
return (micromatch_1.default([domain.hostname], hostnameMatchedProtocol, { | ||
@@ -36,0 +35,0 @@ dot: true |
{ | ||
"name": "@forge/egress", | ||
"version": "1.0.1-next.0", | ||
"version": "1.1.0-next.1", | ||
"description": "Helpers and utils for egress implementation in Forge apps", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5809
100