Skip to content

Commit

Permalink
Using req.accepts() according to implementation. Fixes restify#563
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsoc committed Mar 21, 2014
1 parent 8fa72fc commit 492e7af
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ Response.prototype.format = function format(body, cb) {
var self = this;

if (!type) {
for (var i = 0; i < this.acceptable.length; i++) {
if (this.req.accepts(this.acceptable[i])) {
type = this.acceptable[i];
break;
}
if (this.req.accepts(this.acceptable)) {
type = this.req.accepts(this.acceptable);
}

if (!type) {
Expand Down

0 comments on commit 492e7af

Please sign in to comment.