X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fproto.py;h=0a6a43022004d8d45e7911fc9355d4b120840604;hb=fd7af0a278cf6a58b8ea371e3e84c99c1cb77e0c;hp=8474b3a16e533b2d1cf702d1f7e5ab40eb07a1e7;hpb=b904defe1135d64ae7035b8903c221b0f022b98f;p=wrw.git diff --git a/wrw/proto.py b/wrw/proto.py index 8474b3a..0a6a430 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -85,6 +85,23 @@ def htmlq(html): ret += c return ret +def simpleerror(env, startreq, code, title, msg): + buf = """ + + + +%s + + +

%s

+

%s

+ + +""" % (title, title, htmlq(msg)) + buf = buf.encode("us-ascii") + startreq("%i %s" % (code, title), [("Content-Type", "text/html"), ("Content-Length", str(len(buf)))]) + return [buf] + def urlq(url): ret = "" for c in url: