[projects/pld-builder.new] Checking for application/x-www-form-urlencoded content-type made no sense since we send no such data

arekm arekm at pld-linux.org
Mon Nov 10 19:09:24 CET 2014


commit 73504013b849346b4942ed0dec3ec1d8e2e331b4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Nov 10 19:09:01 2014 +0100

    Checking for application/x-www-form-urlencoded content-type made no sense since we send no such data and this only worked due to luck.

 PLD_Builder/request_handler_server.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/PLD_Builder/request_handler_server.py b/PLD_Builder/request_handler_server.py
index 08370ac..d1a958e 100644
--- a/PLD_Builder/request_handler_server.py
+++ b/PLD_Builder/request_handler_server.py
@@ -26,10 +26,8 @@ class MyHandler(BaseHTTPRequestHandler):
 		filename = "(unknown)"
 		try:
 			length = int(self.headers.getheader('content-length'))
-			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':
+			filename = self.headers.getheader('x-filename')
+			if not length or not filename:
 				log.error("request_handler_server: [%s]: 401 Unauthorized" % self.client_address[0])
 				self.send_error(401)
 				self.end_headers()
@@ -37,8 +35,6 @@ class MyHandler(BaseHTTPRequestHandler):
 
 			query = self.rfile.read(length)
 
-			filename = self.headers.getheader('x-filename')
-
 			if not request_handler.handle_request_main(query, filename = filename):
 				error = log.last_log();
 				log.error("request_handler_server: [%s]: handle_request_main(..., %s) failed" % (self.client_address[0], filename))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/73504013b849346b4942ed0dec3ec1d8e2e331b4



More information about the pld-cvs-commit mailing list