mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-07-19 16:51:29 -05:00
Tried to fix base64 decoding in NAS for ingamesn
Examples of names that broke it before: D-9fAA**, MKIw8zC-MOwwuQ**, MGowizB-, xXzWOP8e-w3-HCYF.
This commit is contained in:
parent
17e55933e1
commit
65fe2e39be
|
|
@ -234,10 +234,13 @@ class NasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||
|
||||
for k, v in ret.iteritems():
|
||||
try:
|
||||
ret[k] = base64.b64decode(v[0].replace("*", "="))
|
||||
# I'm not sure about the replacement for '-', but it'll at least let it be decoded.
|
||||
# For the most part it's not important since it's mostly used for the devname/ingamesn fields.
|
||||
ret[k] = base64.b64decode(v[0].replace("*", "=").replace("?", "/").replace(">","+").replace("-","/"))
|
||||
except TypeError:
|
||||
logger.log(logging.ERROR, "Could not decode following string: ret[%s] = %s" % (k, v[0]))
|
||||
logger.log(logging.ERROR, "url: %s" % str)
|
||||
print "Could not decode following string: ret[%s] = %s" % (k, v[0])
|
||||
print "url: %s" % str
|
||||
ret[k] = v[0] # If you don't assign it like this it'll be a list, which breaks other code.
|
||||
|
||||
return ret
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user