summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/server/main.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/share/server/main.js b/share/server/main.js
index 2bbf1638..13e85ed8 100644
--- a/share/server/main.js
+++ b/share/server/main.js
@@ -142,7 +142,7 @@ var Mimeparse = (function() {
// this function provides a shortcut for managing responses by Accept header
respondWith = function(req, responders) {
var bestKey = null, accept = req.headers["Accept"];
- if (accept) {
+ if (accept && !req.query.format) {
var provides = [];
for (key in responders) {
if (mimesByKey[key]) {
@@ -151,6 +151,8 @@ respondWith = function(req, responders) {
}
var bestMime = Mimeparse.bestMatch(provides, accept);
bestKey = keysByMime[bestMime];
+ } else {
+ bestKey = req.query.format;
}
var rFunc = responders[bestKey || responders.fallback || "html"];
if (rFunc) {