Skip to content

Commit

Permalink
Preserve order on accepted* calls
Browse files Browse the repository at this point in the history
  • Loading branch information
federomero committed Sep 19, 2013
1 parent 6c12592 commit 9bbd671
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/charset.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function preferredCharsets(accept, provided) {
} else {
return accept.sort(function (a, b) {
// revsort
return a.q > b.q ? -1 : 1;
return a.q < b.q ? 1 : -1;
}).map(function(type) {
return type.charset;
});
Expand Down
2 changes: 1 addition & 1 deletion lib/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function preferredEncodings(accept, provided) {
} else {
return accept.sort(function (a, b) {
// revsort
return a.q > b.q ? -1 : 1;
return a.q < b.q ? 1 : -1;
}).map(function(type) {
return type.encoding;
});
Expand Down
2 changes: 1 addition & 1 deletion lib/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function preferredLanguages(accept, provided) {
} else {
return accept.sort(function (a, b) {
// revsort
return a.q > b.q ? -1 : 1;
return a.q < b.q ? 1 : -1;
}).map(function(type) {
return type.full;
});
Expand Down
2 changes: 1 addition & 1 deletion lib/mediaType.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function preferredMediaTypes(accept, provided) {
} else {
return accept.sort(function (a, b) {
// revsort
return a.q > b.q ? -1 : 1;
return a.q < b.q ? 1 : -1;
}).map(function(type) {
return type.full;
});
Expand Down

0 comments on commit 9bbd671

Please sign in to comment.