Skip to content
Myr

Allow multiple call concatenation for res.links. Fixes #1683

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Eduardo Sorribas · committed by Eduardo Sorribas · parent e5de08f · Browse files · 2 files+16 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−1 removed

  • tests:+13 added−0 removed
  • other:+3 added−1 removed

2 files+16 added−1 removed

modified:lib/response.js+3 added-1 removed
53 unmodified lines
54 * @api public55 */5657res.links = function(links){58 var linkField = typeof this.get('Link') === 'undefined' ?59 '' : this.get('Link') + ', ';58 return this.set('Link', Object.keys(links).map(function(rel){60 return this.set('Link', linkField + Object.keys(links).map(function(rel){61 return '<' + links[rel] + '>; rel="' + rel + '"';62 }).join(', '));63};64
737 unmodified lines
modified:test/res.links.js+13 added