Skip to content
Snippets Groups Projects
Commit c86d9031 authored by developer23's avatar developer23
Browse files

4.0.5.5

- GetHandler():
	- added SetHeaders();
parent 191846d3
No related merge requests found
...@@ -176,6 +176,12 @@ class GetHandler(BaseHTTPRequestHandler): ...@@ -176,6 +176,12 @@ class GetHandler(BaseHTTPRequestHandler):
except IOError: except IOError:
self.send_error(404, 'File Not Found: %s' % self.path) self.send_error(404, 'File Not Found: %s' % self.path)
return None return None
def SetHeaders(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
def do_GET(self): def do_GET(self):
try: try:
...@@ -451,11 +457,12 @@ class GetHandler(BaseHTTPRequestHandler): ...@@ -451,11 +457,12 @@ class GetHandler(BaseHTTPRequestHandler):
if not os.path.basename(sys.argv[0]) == AIS_HTTP: if not os.path.basename(sys.argv[0]) == AIS_HTTP:
try: try:
from ais_readers_main_process import DoPOST from ais_readers_main_process import DoPOST
writefile, content = DoPOST(f, **pq) writefile, content = DoPOST(f, **pq)
if writefile: if writefile:
return self.WriteFile(content) return self.WriteFile(content)
else: else:
return self.wfile.write(content) self.SetHeaders()
return self.wfile.write(content)
except Exception as exc: except Exception as exc:
self.wfile.write(exc) self.wfile.write(exc)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment