Skip to content

Commit

Permalink
Fixing how a string comparison is made within hypermedia()
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Apr 21, 2019
1 parent a84b967 commit 133fe1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function hypermedia (server, req, rep, headers) {
}

if (scheme(lkey) === false) {
uri = `${lcollection.charAt(0) === "/" ? "" : "/"}${lcollection.replace(/\s/g, "%20")}/${lkey.replace(/\s/g, "%20")}`;
uri = `${lcollection.startsWith("/") ? "" : "/"}${lcollection.replace(/\s/g, "%20")}/${lkey.replace(/\s/g, "%20")}`;

if (uri !== root && seen.has(uri) === false) {
seen.add(uri);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "11.0.1",
"version": "11.0.2",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 133fe1d

Please sign in to comment.