Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check for metadata in headers for use with `getThumbnail()`

  • Loading branch information...
commit 59ef745ae171a54a7b9e931d19ed9fb145e34a02 1 parent 3087a85
Roly Fentanes fent authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/dropbox-node.js
9 lib/dropbox-node.js
View
@@ -45,6 +45,8 @@ DropboxClient.prototype.request =
function(err, res, body) {
if (err) return callback(err);
var contentType = res.headers['content-type'];
+
+ // check if the response body is in JSON format
if (contentType === 'application/json' ||
contentType === 'text/javascript') {
body = JSON.parse(body);
@@ -60,7 +62,12 @@ DropboxClient.prototype.request =
return callback(err);
}
- callback(null, body);
+ // check for metadata in headers
+ if (res.headers['x-dropbox-metadata']) {
+ var metadata = JSON.parse(res.headers['x-dropbox-metadata']);
+ }
+
+ callback(null, body, metadata);
} : undefined);
};
Please sign in to comment.
Something went wrong with that request. Please try again.