Skip to content
This repository has been archived by the owner on Jul 26, 2018. It is now read-only.

Commit

Permalink
Allow collapsing of types into another aggregate type in filesreader
Browse files Browse the repository at this point in the history
  • Loading branch information
unconed committed Jun 13, 2011
1 parent e291e5e commit 1517643
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions Node/shell/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ exports.default = function (type) {
*/
exports.composable = function () {
return {
'application/json': 'text/plain',
'application/javascript': true,
'application/x-perl': true,
'application/x-php': true,
Expand Down
8 changes: 7 additions & 1 deletion Node/shell/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,13 @@ exports.filesReader.prototype = {
else {
// Only return a unified type for content types which can be composed safely.
var composable = meta.composable();
return composable[prefix] && prefix || 'application/octet-stream';
if (composable[prefix]) {
if (typeof composable[prefix] == 'string') {
return composable[prefix];
}
return prefix;
}
return 'application/octet-stream';
}
},

Expand Down

0 comments on commit 1517643

Please sign in to comment.