Support for gzip and deflate content encoding
This commit is contained in:
1 parent
4048de35d0
commit
bf8fc877d4
2 files changed
+45
-16
No files matched your search
+2
-5
@@ -257,7 +257,7 @@ exports.request = (httpRequest) ->
|
||||
|
||||
data = httpRequest.getBody()
|
||||
|
||||
if +httpRequest.headers['Content-Length'] > 0 || data.length > 0
|
||||
if data.length > 0
|
||||
try
|
||||
xml = libxmljs.parseXml data
|
||||
catch err
|
||||
@@ -398,9 +398,6 @@ exports.response = (cwmpResponse) ->
|
||||
headers['Set-Cookie'] = cookiesToStr(cwmpResponse.cookies)
|
||||
|
||||
if env?
|
||||
data = env.doc().toString()
|
||||
headers['Content-Length'] = data.length
|
||||
return {code: 200, headers: headers, data: data}
|
||||
return {code: 200, headers: headers, data: env.doc().toString()}
|
||||
else
|
||||
headers['Content-Length'] = 0
|
||||
return {code: 204, headers: headers, data: ''}
|
||||
Reference in new issue
Block a user