commit 273a778e59d7b8c2d164bb19050510b93cec6016
Author: Arkadiusz Miƛkiewicz <ar...@maven.pl>
Date:   Mon Nov 10 18:50:08 2014 +0100

    Check if content-type headers exists.

 PLD_Builder/request_handler_server.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/PLD_Builder/request_handler_server.py 
b/PLD_Builder/request_handler_server.py
index b0eafbc..08370ac 100644
--- a/PLD_Builder/request_handler_server.py
+++ b/PLD_Builder/request_handler_server.py
@@ -26,8 +26,10 @@ class MyHandler(BaseHTTPRequestHandler):
                filename = "(unknown)"
                try:
                        length = int(self.headers.getheader('content-length'))
-                       ctype, pdict = 
cgi.parse_header(self.headers.getheader('content-type'))
-                       if ctype != 'application/x-www-form-urlencoded':
+                       raw_ctype = ctype = 
self.headers.getheader('content-type')
+                       if raw_ctype:
+                               ctype, pdict = cgi.parse_header(raw_ctype)
+                       if not raw_ctype or ctype != 
'application/x-www-form-urlencoded':
                                log.error("request_handler_server: [%s]: 401 
Unauthorized" % self.client_address[0])
                                self.send_error(401)
                                self.end_headers()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/273a778e59d7b8c2d164bb19050510b93cec6016

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to