Add Debian directory
[mspang/vmailman.git] / debian / patches / 11_handle_propfind.patch
1 Patch: 11_handle_propfind.patch
2 Author: Tollef Fog Heen <tfheen@debian.org>
3 Submitted upstream: http://sourceforge.net/tracker/index.php?func=detail&aid=1578756&group_id=103&atid=300103
4 Don't fall flat on our face if we get a request type which we
5 don't understand.
6 Index: scripts/driver
7 ===================================================================
8 --- scripts/driver.orig 2006-08-15 15:12:18.000000000 +0800
9 +++ scripts/driver      2006-08-15 15:14:26.000000000 +0800
10 @@ -95,6 +95,15 @@
11          module = getattr(pkg, scriptname)
12          main = getattr(module, 'main')
13          try:
14 +            import os
15 +            request_method = os.environ.get('REQUEST_METHOD')
16 +            if not request_method in ['GET', 'POST', 'HEAD']:
17 +                print "Status: 405 Method not allowed"
18 +                print "Content-type: text/plain"
19 +                print
20 +                print "The method is not allowed"
21 +                sys.exit()
22 +                
23              try:
24                  sys.stderr = logger
25                  sys.stdout = tempstdout