support netscape 3.0

This commit is contained in:
ed 2019-06-04 22:48:29 +00:00
parent 5d8be84d18
commit e7dc7c9997
2 changed files with 14 additions and 7 deletions

View file

@ -69,6 +69,9 @@ class HttpCli(object):
continue continue
v = unescape_cookie(v) v = unescape_cookie(v)
if v == "x":
break
if not v in self.auth.iuser: if not v in self.auth.iuser:
msg = u'bad_cpwd "{}"'.format(v) msg = u'bad_cpwd "{}"'.format(v)
nuke = u"Set-Cookie: cppwd=x; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT" nuke = u"Set-Cookie: cppwd=x; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"
@ -83,12 +86,16 @@ class HttpCli(object):
print(self.rvol) print(self.rvol)
print(self.wvol) print(self.wvol)
if mode == "GET": try:
self.handle_get() if mode == "GET":
elif mode == "POST": self.handle_get()
self.handle_post() elif mode == "POST":
else: self.handle_post()
self.loud_reply(u'invalid HTTP mode "{0}"'.format(mode)) else:
self.loud_reply(u'invalid HTTP mode "{0}"'.format(mode))
except Pebkac as ex:
self.loud_reply(str(ex))
def panic(self, msg): def panic(self, msg):
self.log("client disconnected ({0})".format(msg).upper()) self.log("client disconnected ({0})".format(msg).upper())

View file

@ -60,7 +60,7 @@ class MultipartParser(object):
if m.group(1).lower() == "multipart/mixed": if m.group(1).lower() == "multipart/mixed":
# rfc-7578 overrides rfc-2388 so this is not-impl # rfc-7578 overrides rfc-2388 so this is not-impl
# (opera >=9 <11.10 is the only thing i've ever seen use it) # (opera >=9 <11.10 is the only thing i've ever seen use it)
raise Exception( raise Pebkac(
"you can't use that browser to upload multiple files at once" "you can't use that browser to upload multiple files at once"
) )