Skip to content

Commit

Permalink
Removing external URIs from links due to header value size issues w…
Browse files Browse the repository at this point in the history
…hen dealing with large collections which link to many URIs; sample from work project had a 46 KB Link header
  • Loading branch information
avoidwork committed Dec 17, 2018
1 parent 40b2134 commit 28d0017
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,7 @@ function hypermedia (server, req, rep, headers) {
lrel = "item";
}

if (regex.scheme.test(obj[i])) {
uri = obj[i];

if (seen.has(uri) === false) {
seen.add(uri);
links.push({uri: uri, rel: lrel});
}
} else {
if (regex.scheme.test(obj[i]) === false) {
uri = `/${lcollection.replace(/\s/g, "%20")}/${obj[i].toString().replace(/\s/g, "%20")}`;

if (uri !== root && seen.has(uri) === false) {
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": "10.0.9",
"version": "10.0.10",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

1 comment on commit 28d0017

@travrob1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

Please sign in to comment.