X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=icalparse.py;fp=icalparse.py;h=95d52089ba166c7ae1fb88dd24454af2c3ade12c;hb=c50d84b9a5feb92381ee2cdb28b6e9a055ae88b6;hp=a573b4893c25a4004017d66e06b4148a0b6f89a4;hpb=eda6d72ca86cc176af68a8c2c6a2dfa51197665f;p=frenchie%2Ficalparse.git diff --git a/icalparse.py b/icalparse.py index a573b48..95d5208 100755 --- a/icalparse.py +++ b/icalparse.py @@ -201,7 +201,7 @@ def runLocal(): def exitQuiet(exitstate=0): '''When called as a CGI script, exit quietly if theres any errors''' - print('Content-Type: text/html\n') + print('Content-Type: text/calendar\n') sys.exit(exitstate) @@ -210,14 +210,13 @@ def runCGI(): to process facebook ical files''' import cgi import re - import cgitb; cgitb.enable() + #import cgitb; cgitb.enable() ruleConfig["facebook"] = True form = cgi.FieldStorage() if "uid" not in form or "key" not in form: - print('Content-Type: text/calendar\n') - sys.exit(0) + exitQuiet() try: # UID should be numeric, if it's not we have someone playing games uid = int(form['uid'].value)