You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When linking to a substantial number of bucket/key pairs and the bucket names and keys are fairly long then the 8k header limit imposed by Apache was hit. This problem has been solved in the Python Riak driver but it keills riak-js.
I made it work by returning an array of link header strings instead of one long string. The http module in Node will turn that array into a series of link headers as prescribed by the http standard and so it should work on any web server. It work in Riak anyway ... but I have not tested it extensively.
Here is the code I used for the linkUtils in http_meta.js
When linking to a substantial number of bucket/key pairs and the bucket names and keys are fairly long then the 8k header limit imposed by Apache was hit. This problem has been solved in the Python Riak driver but it keills riak-js.
I made it work by returning an array of link header strings instead of one long string. The http module in Node will turn that array into a series of link headers as prescribed by the http standard and so it should work on any web server. It work in Riak anyway ... but I have not tested it extensively.
Here is the code I used for the linkUtils in http_meta.js
linksToString: function(links, raw) {
var linkHeaders = [];
var max_header_length = 8192 - 6; // substract length of "Link: " header string
var linksLen = links.length;
var linkStr = '', linkStrLen = 0;
while(linksLen--){
var link = links[linksLen];
var curLinkStr = (linkStr == "" ? "" : ", ") + "</" + raw + "/" + (encodeURIComponent(link.bucket)) + "/" + (encodeURIComponent(link.key)) + ">; riaktag="" + (encodeURIComponent(link.tag || "_")) + """;
var curLinkStrLen = curLinkStr.length;
if((linkStrLen + curLinkStrLen) > max_header_length){
linkHeaders.push(linkStr);
linkStr = curLinkStr.substr(2);
continue;
}
linkStr += curLinkStr;
linkStrLen += curLinkStrLen;
}
linkHeaders.push(linkStr);
return linkHeaders.length > 1 ? linkHeaders : linkHeaders[0];
}
The text was updated successfully, but these errors were encountered: