@forge/egress
Advanced tools
Comparing version 1.2.0 to 1.2.1-next.0
# @forge/egress | ||
## 1.2.1-next.0 | ||
### Patch Changes | ||
- f18ccd86: Fixed bug greedily extracting the protocol from provided egress domains | ||
## 1.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -5,3 +5,2 @@ export declare class EgressFilteringService { | ||
private readonly allowsEverything; | ||
private readonly DEFAULT_PROTOCOL; | ||
constructor(allowList: string[]); | ||
@@ -8,0 +7,0 @@ private parseUrl; |
@@ -9,3 +9,2 @@ "use strict"; | ||
constructor(allowList) { | ||
this.DEFAULT_PROTOCOL = 'https://'; | ||
this.URLs = allowList.filter((domainOrURL) => !domainOrURL.startsWith('*')).map((url) => this.parseUrl(url)); | ||
@@ -19,5 +18,3 @@ this.wildcardDomains = allowList | ||
parseUrl(url) { | ||
const protocolRegex = /^(.*:\/\/)/; | ||
const urlWithProtocol = protocolRegex.test(url) ? url : `${this.DEFAULT_PROTOCOL}${url}`; | ||
return (0, url_parser_1.parseUrl)(urlWithProtocol); | ||
return (0, url_parser_1.parseUrl)(url); | ||
} | ||
@@ -24,0 +21,0 @@ isValidUrl(url) { |
@@ -6,6 +6,9 @@ "use strict"; | ||
var _a, _b; | ||
const protocol = (_b = (_a = url.match(/^(.*:\/\/)/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 'https://'; | ||
const hostname = url.replace(protocol, '').split(/[\/?]/)[0]; | ||
const protocol = (_b = (_a = url.match(/^(.*?:)/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 'https:'; | ||
const hostname = url | ||
.replace(protocol, '') | ||
.replace(/^\/*/, '') | ||
.split(/[\?\/]/)[0]; | ||
return { protocol, hostname }; | ||
} | ||
exports.parseUrl = parseUrl; |
{ | ||
"name": "@forge/egress", | ||
"version": "1.2.0", | ||
"version": "1.2.1-next.0", | ||
"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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
7178
101
2