Permalink
Browse files

fixed content-type bug when updating user objects by id

  • Loading branch information...
1 parent d157609 commit b454d0591652bcf12fc5cf95c216f5d55180fddd @ritch ritch committed Feb 7, 2013
Showing with 7 additions and 3 deletions.
  1. +4 −0 HISTORY.md
  2. +1 −1 README.md
  3. +1 −1 lib/resources/user-collection.js
  4. +1 −1 package.json
View
@@ -1,5 +1,9 @@
# History
+## 0.6.11
+
+ - Fixed bug where missing content-type header when updating a user threw an error.
+
## 0.6.10
- Fixed bug where query strings were not properly parsed.
View
@@ -1,4 +1,4 @@
-# deployd v0.6.10
+# deployd v0.6.11
[![Build Status](https://secure.travis-ci.org/deployd/deployd.png)](http://travis-ci.org/deployd/deployd)
@@ -117,7 +117,7 @@ UserCollection.prototype.handle = function (ctx) {
var salt = uuid.create(SALT_LEN);
ctx.body.password = salt + this.hash(ctx.body.password, salt);
}
- var isSelf = ctx.session.user && ctx.session.user.id === ctx.query.id || ctx.body.id;
+ var isSelf = ctx.session.user && ctx.session.user.id === ctx.query.id || (ctx.body && ctx.body.id);
if ((ctx.query.id || ctx.body.id) && ctx.body && !isSelf && !ctx.session.isRoot && !ctx.req.internal) {
delete ctx.body.username;
delete ctx.body.password;
View
@@ -1,7 +1,7 @@
{
"author": "Ritchie Martori",
"name": "deployd",
- "version": "0.6.10",
+ "version": "0.6.11",
"description": "the simplest way to build realtime APIs for web and mobile apps",
"repository": {
"url": "git://github.com/deployd/deployd.git"

0 comments on commit b454d05

Please sign in to comment.