Skip to content

Commit

Permalink
Merge pull request #3 from HcDevel/Issue-#2
Browse files Browse the repository at this point in the history
Solved Issue #2
  • Loading branch information
HcDevel authored and HcDevel committed Apr 27, 2014
2 parents d752d45 + ebe3203 commit 5cdf577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion document.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def request (self, url): #Sends a HTTP request (useful for HTTP APIS). If you do
return(f.read().decode('utf-8'))

def send (self): #Send the answer to the browser
self.connection.send_header(self.header[0], self.header[1])
self.connection.send_response(self.response)
self.connection.send_header(self.header[0], self.header[1])
self.connection.end_headers()

if (self.response != 302):
Expand Down
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def do_GET(self):
#Decide wether a search or the style.css was requested
if (path == "/style.css"):
self.document = open('style.css', 'r').read()
self.send_header('Content-type', 'text/html')
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write(bytes(self.document, "utf-8"))
elif (path == "/proxy.pac"):
Expand All @@ -62,8 +62,8 @@ def do_GET(self):
self.document = self.document.replace('<google_domain>', google_domain, 1)
self.document = self.document.replace('<squid_host>', squid_hostname, 1)
self.document = self.document.replace('<squid_port>', str(squid_port), 1)
self.send_header('Content-type', 'x-ns-proxy-autoconfig')
self.send_response(200)
self.send_header('Content-type', 'x-ns-proxy-autoconfig')
self.end_headers()
self.wfile.write(bytes(self.document, "utf-8"))
elif (arguments["q"] != None):
Expand All @@ -72,8 +72,8 @@ def do_GET(self):
command = commands(self)
search(command).search(arguments["q"])
else:
self.send_header('Content-type', 'text/html')
self.send_response(404)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write(bytes('Not found. Please visit <a href="https://github.com/HcDevel/Siri-API/wiki/_pages">https://github.com/HcDevel/Siri-API/wiki/_pages</a>', "utf-8"))

Expand Down

0 comments on commit 5cdf577

Please sign in to comment.