Separate standard headers from extra headers
This commit is contained in:
parent
8179643067
commit
d86722c3cb
@ -203,19 +203,20 @@ class AjaxServer:
|
|||||||
|
|
||||||
|
|
||||||
def setHeader(self, name, value):
|
def setHeader(self, name, value):
|
||||||
self.headers[name] = value
|
self.extraHeaders[name] = value
|
||||||
|
|
||||||
|
|
||||||
def resetHeaders(self):
|
def resetHeaders(self):
|
||||||
self.headers = {
|
self.headers = [
|
||||||
'HTTP/1.1 200 OK': None,
|
['HTTP/1.1 200 OK', None],
|
||||||
'Content-Type': 'text/json'
|
['Content-Type', 'text/json']
|
||||||
}
|
]
|
||||||
|
self.extraHeaders = {}
|
||||||
|
|
||||||
|
|
||||||
def getHeaders(self):
|
def getHeaders(self):
|
||||||
headers = []
|
headers = self.headers
|
||||||
for name in self.headers:
|
for name in self.extraHeaders:
|
||||||
headers.append([name, self.headers[name]])
|
headers.append([name, self.headers[name]])
|
||||||
return headers
|
return headers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user