Change http headers from list to dict
This commit is contained in:
parent
b55832df34
commit
b0a8c4d278
4 changed files with 27 additions and 28 deletions
|
@ -44,10 +44,10 @@ class UiRequestPlugin(object):
|
|||
upload_info = upload_nonces[nonce]
|
||||
del upload_nonces[nonce]
|
||||
|
||||
self.sendHeader(200, "text/html", noscript=True, extra_headers=[
|
||||
("Access-Control-Allow-Origin", "null"),
|
||||
("Access-Control-Allow-Credentials", "true")
|
||||
])
|
||||
self.sendHeader(200, "text/html", noscript=True, extra_headers={
|
||||
"Access-Control-Allow-Origin": "null",
|
||||
"Access-Control-Allow-Credentials": "true"
|
||||
})
|
||||
|
||||
self.readMultipartHeaders(self.env['wsgi.input']) # Skip http headers
|
||||
|
||||
|
|
|
@ -143,8 +143,8 @@ class UiRequestPlugin(object):
|
|||
if address in site_blacklist:
|
||||
site = self.server.site_manager.get(config.homepage)
|
||||
if not extra_headers:
|
||||
extra_headers = []
|
||||
self.sendHeader(extra_headers=extra_headers[:])
|
||||
extra_headers = {}
|
||||
self.sendHeader(extra_headers=extra_headers)
|
||||
return iter([super(UiRequestPlugin, self).renderWrapper(
|
||||
site, path, "uimedia/plugins/mute/blacklisted.html?address=" + address,
|
||||
"Blacklisted site", extra_headers, show_loadingscreen=False
|
||||
|
|
|
@ -48,8 +48,8 @@ class UiRequestPlugin(object):
|
|||
|
||||
if user_created:
|
||||
if not extra_headers:
|
||||
extra_headers = []
|
||||
extra_headers.append(('Set-Cookie', "master_address=%s;path=/;max-age=2592000;" % user.master_address)) # = 30 days
|
||||
extra_headers = {}
|
||||
extra_headers['Set-Cookie'] = "master_address=%s;path=/;max-age=2592000;" % user.master_address # = 30 days
|
||||
|
||||
loggedin = self.get.get("login") == "done"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue