exports.AllowedMethods = function (app, methods) {
    return function (env) {
        if (methods.indexOf(env.REQUEST_METHOD) === -1) return {
            status : 405,
            headers : {"Content-Type":"text/plain"},
            body : [
                "Method Not Allowed: "+env["REQUEST_METHOD"] +"\n"+
                "Allowed methods: "+methods.join(",")
            ]
        };
        return app(env);
    };
};
            
@@ -190,35 +190,118 @@
  : %7B
-%22Content-Type%22:%22text/plain%22
+%0A                %22Content-Type%22 : %22application/json%22,%0A                %22Allow%22 : methods.join(%22,%22)%0A            
 %7D,%0A 
@@ -319,16 +319,32 @@
 body : %5B
+JSON.stringify(%7B
 %0A       
@@ -351,16 +351,24 @@
         
+ error :
  %22Method
@@ -408,15 +408,9 @@
 OD%22%5D
- +%22%5Cn%22+
+,
 %0A   
@@ -426,45 +426,23 @@
     
-%22A
+a
 llow
-ed methods: %22+methods.join(%22,%22)
+ : methods
 %0A   
@@ -450,16 +450,18 @@
         
+%7D)
 %5D%0A      

Make the 405 response more valid, and also JSON.