diff --git a/netdb.i2p2/fixedapp.py b/netdb.i2p2/fixedapp.py index cc491aef73c747d949be8abe55b0e5511e0020bb..1a33372983bd03bc955dc1de9cdc4428962a03d1 100644 --- a/netdb.i2p2/fixedapp.py +++ b/netdb.i2p2/fixedapp.py @@ -90,6 +90,7 @@ class Response(BaseResponse, ETagResponseMixin): def application(environ, start_response): """The WSGI application that connects all together.""" + checkdatabase() req = Request(environ) remote = req.remote_addr now = time() @@ -197,7 +198,7 @@ def application(environ, start_response): cur.execute("select * from entry where wht = ?", chkpath) chk = cur.fetchall() if len(chk) == 0: - resp = Response("Do you not have anything better to do?\nRequested file "+repr(path)+"\nchk "+repr(chkpath)+"\n", status=400, mimetype='text/plain') + resp = Response("Do you not have anything better to do?", status=400, mimetype='text/plain') else: try: # load file @@ -207,13 +208,11 @@ def application(environ, start_response): resp.add_etag() except IOError: # 404 - resp = Response("Owch! Could not find file!", status=404, mimetype='text/plain') + resp = Response("Owch! Could not find file! It got deleted before you could get a copy, sorry.", status=404, mimetype='text/plain') cnxn.commit() cnxn.close() return resp(environ, start_response) -checkdatabase() - if __name__ == '__main__': from werkzeug import run_simple run_simple('localhost', 5007, application)