Skip to content

Commit cbb0517

Browse files
committed
Fixed prependBase to start path with a '/' for a zero length path if there is an authority in base.
1 parent c1ed142 commit cbb0517

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Fixed
66
- Exclude `@type` from added values in Merge Node Maps step 2.2.1.
7+
- Fixed `prependBase` to start path with a '/' for a zero length path
8+
if there is an authority in base.
79

810
## 3.0.0 - 2020-03-10
911

lib/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ api.prependBase = (base, iri) => {
107107

108108
// append relative path to the end of the last directory from base
109109
path = path.substr(0, path.lastIndexOf('/') + 1);
110-
if(path.length > 0 && path.substr(-1) !== '/') {
110+
if((path.length > 0 || base.authority) && path.substr(-1) !== '/') {
111111
path += '/';
112112
}
113113
path += rel.path;

0 commit comments

Comments
 (0)