Skip to content
Myr

Added: `res.respondTo()` defaults the content-type

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

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent b565e25 · Browse files · 2 files+14 added−2 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+14 added−2 removed

  • tests:+12 added−1 removed
  • other:+2 added−1 removed

2 files+14 added−2 removed

modified:lib/response.js+2 added-1 removed
338 unmodified lines
339340 if (!accepted.length) key = keys.shift();341342 if (key) {343 this.set('Content-Type', key);343 obj[key](req, res, next);344 obj[key](req, this, next);345 } else {346 var err = new Error('Not Acceptable');347 err.status = 406;348 err.types = keys;
279 unmodified lines
modified:test/res.respondTo.js+12 added-1 removed