Apply 11_handle_propfind.patch
authorMichael Spang <mspang@uwaterloo.ca>
Thu, 13 Sep 2007 00:32:51 +0000 (20:32 -0400)
committerMichael Spang <mspang@uwaterloo.ca>
Thu, 13 Sep 2007 00:32:51 +0000 (20:32 -0400)
scripts/driver

index ea43c40..9a7783f 100644 (file)
@@ -95,6 +95,15 @@ def run_main():
         module = getattr(pkg, scriptname)
         main = getattr(module, 'main')
         try:
+            import os
+            request_method = os.environ.get('REQUEST_METHOD')
+            if not request_method in ['GET', 'POST', 'HEAD']:
+                print "Status: 405 Method not allowed"
+                print "Content-type: text/plain"
+                print
+                print "The method is not allowed"
+                sys.exit()
+                
             try:
                 sys.stderr = logger
                 sys.stdout = tempstdout