Skip to content

Commit 49721b1

Browse files
gkelloggdavidlehn
authored andcommitted
Fixed prependBase.
Fixed `prependBase` to start path with a '/' for a zero length path if there is an authority in base.
1 parent 07e5cd5 commit 49721b1

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### Fixed
44
- Support recusrive scoped contexts.
55
- Various EARL report updates.
6+
- Fixed `prependBase` to start path with a '/' for a zero length path
7+
if there is an authority in base.
68

79
### Changed
810
- Better support for using a processed context for `null` and caching

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;

tests/test-common.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ const TEST_TYPES = {
5959
// NOTE: idRegex format:
6060
//MMM-manifest#tNNN$/,
6161
idRegex: [
62-
// IRI resolution (PR #384)
63-
/expand-manifest#t0129$/,
64-
6562
// html
6663
/html-manifest#te001$/,
6764
/html-manifest#te002$/,
@@ -182,9 +179,6 @@ const TEST_TYPES = {
182179
// NOTE: idRegex format:
183180
//MMM-manifest#tNNN$/,
184181
idRegex: [
185-
// IRI resolution (PR #384)
186-
/toRdf-manifest#te129$/,
187-
188182
// well formed
189183
/toRdf-manifest#twf05$/,
190184

0 commit comments

Comments
 (0)