diff --git a/Request.js b/Request.js index 2bbd955..0e9e682 100644 --- a/Request.js +++ b/Request.js @@ -34,18 +34,21 @@ define([ headers: { enumerable: true, value: req.headers - }, + } + }); - /** - * node-http-server.Request#body -> node-stream.Stream - * - * A stream for the request body. - **/ - body: { + /** + * node-http-server.Request#body -> node-stream.Stream + * + * A stream for the request body, unless the request method is GET, DELETE + * or HEAD. + **/ + if(req.method !== "GET" && req.method !== "DELETE" && req.method !== "HEAD"){ + Object.defineProperty(this, "body", { enumerable: true, value: new Stream(req) - } - }); + }); + } /** * node-http-server.Request#expectContinue -> promise.Deferred