This commit is contained in:
wn
2008-03-20 11:50:43 +01:00
parent 97191133f4
commit c1e9689ce5

View File

@ -3,6 +3,9 @@ import time
import Event
from logger import Logger
import BaseHTTPServer
import SocketServer
import cgi
import urlparse
import Entry
@ -18,12 +21,15 @@ class HttpCmdHandler(BaseHTTPServer.BaseHTTPRequestHandler):
cls.entries = entries
cls.adminPwd = adminPwd
def do_POST(self):
def do_GET(self):
Logger.log("Request: %s" % self.path)
if self.command == "POST":
q = self.rfile.read(l)
e = cgi.parse_qs(q)
Logger.log("QUERY: %s" % str(e))
if self.command == "GET":
q = urlparse.urlparse(self.path).query
c = cgi.parse_qs(q)
cmd = c['c']
dynid = c['d']
sharedSecret = c['s']
Logger.log("c: %s, d: %s, s: %s" % (cmd, dynid, sharedSecret))
self.send_response(200, "OK")
self.end_headers()