@equinor/fusion-framework-module-http
Advanced tools
Comparing version 6.0.3 to 6.1.0-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237
# Change Log | ||
## 6.1.0-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237 | ||
### Minor Changes | ||
- [#2452](https://github.com/equinor/fusion-framework/pull/2452) [`c776845`](https://github.com/equinor/fusion-framework/commit/c776845e753acf4a0bceda1c59d31e5939c44c31) Thanks [@odinr](https://github.com/odinr)! - **@equinor/fusion-framework-module-http** | ||
`HttpClient._resolveUrl` now supports resolving URLs with a base URL that contains a path. | ||
before: | ||
```typescript | ||
const client = new HttpClient('https://example.com/test/me'); | ||
client.fetch('/api'); // https://example.com/api | ||
``` | ||
now: | ||
```typescript | ||
const client = new HttpClient('https://example.com/test/me'); | ||
client.fetch('/api'); // https://example.com/test/me/api | ||
``` | ||
### Patch Changes | ||
- Updated dependencies [[`2644b3d`](https://github.com/equinor/fusion-framework/commit/2644b3d63939aede736a3b1950db32dbd487877d)]: | ||
- @equinor/fusion-framework-module@4.3.5-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237 | ||
- @equinor/fusion-framework-module-msal@3.1.5-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237 | ||
## 6.0.3 | ||
@@ -4,0 +32,0 @@ |
@@ -250,6 +250,7 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
_resolveUrl(path) { | ||
const baseUrl = this.uri || window.location.origin; | ||
return new URL(path, baseUrl).href; | ||
const { origin, pathname: basePath } = new URL(this.uri || window.location.origin); | ||
const pathname = [basePath, path].join('/').replace(/\/{2,}/g, '/'); | ||
return new URL(pathname, origin).href; | ||
} | ||
} | ||
//# sourceMappingURL=client.js.map |
{ | ||
"name": "@equinor/fusion-framework-module-http", | ||
"version": "6.0.3", | ||
"version": "6.1.0-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237", | ||
"description": "", | ||
@@ -58,4 +58,4 @@ "main": "dist/esm/index.js", | ||
"rxjs": "^7.8.1", | ||
"@equinor/fusion-framework-module-msal": "^3.1.4", | ||
"@equinor/fusion-framework-module": "^4.3.4" | ||
"@equinor/fusion-framework-module": "^4.3.5-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237", | ||
"@equinor/fusion-framework-module-msal": "^3.1.5-alpha-17c4eed176e5b4a0fcf867ed245471d3863af237" | ||
}, | ||
@@ -62,0 +62,0 @@ "devDependencies": { |
@@ -350,5 +350,6 @@ import { firstValueFrom, of, Subject } from 'rxjs'; | ||
protected _resolveUrl(path: string): string { | ||
const baseUrl = this.uri || window.location.origin; | ||
return new URL(path, baseUrl).href; | ||
const { origin, pathname: basePath } = new URL(this.uri || window.location.origin); | ||
const pathname = [basePath, path].join('/').replace(/\/{2,}/g, '/'); | ||
return new URL(pathname, origin).href; | ||
} | ||
} |
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
352426
3218
2