diff --git a/lib/server/commands/Get.js b/lib/server/commands/Get.js index 45c25618..5c2cbe41 100644 --- a/lib/server/commands/Get.js +++ b/lib/server/commands/Get.js @@ -13,7 +13,14 @@ function default_1(arg, callback) { arg.setCode(WebDAVRequest_1.HTTPCodes.NotFound); else { arg.setCode(WebDAVRequest_1.HTTPCodes.OK); - arg.response.write(c ? c : new Buffer(0)); + var content = c; + if (c === undefined || c === null) + content = new Buffer(0); + else if (c.constructor === Boolean || c.constructor === Number) + content = c.toString(); + else + content = c; + arg.response.write(content); } callback(); }); diff --git a/src/server/commands/Get.ts b/src/server/commands/Get.ts index eeeac91d..a7b94ffa 100644 --- a/src/server/commands/Get.ts +++ b/src/server/commands/Get.ts @@ -17,7 +17,16 @@ export default function(arg : MethodCallArgs, callback) else { arg.setCode(HTTPCodes.OK); - arg.response.write(c ? c : new Buffer(0)); + + let content : any = c; + if(c === undefined || c === null) + content = new Buffer(0); + else if(c.constructor === Boolean || c.constructor === Number) + content = c.toString() + else + content = c; + + arg.response.write(content); } callback(); })