[Pkg-javascript-commits] [node-static] 147/151: We accept POST too

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Tue Jan 7 23:18:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository node-static.

commit 716718da41f71edddf413cae2700f47c6320999c
Author: valentinvieriu <valentin.vieriu at gmail.com>
Date:   Fri Oct 11 09:16:28 2013 +0200

    We accept POST too
    
    Needed this to be able to use node-static as a webserver for a Facebook Application
---
 lib/node-static.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/node-static.js b/lib/node-static.js
index 5e0cc3c..5f8bd3b 100644
--- a/lib/node-static.js
+++ b/lib/node-static.js
@@ -134,7 +134,7 @@ Server.prototype.servePath = function (pathname, status, headers, req, res, fini
     pathname = this.resolve(pathname);
 
     // Only allow GET and HEAD requests
-    if (req.method !== 'GET' && req.method !== 'HEAD') {
+    if (req.method !== 'GET' && req.method !== 'HEAD' && req.method !== 'POST') {
         finish(405, { 'Allow': 'GET, HEAD' });
         return promise;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-static.git



More information about the Pkg-javascript-commits mailing list