mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-01 11:39:01 +00:00
stringify the error object in header
This commit is contained in:
@@ -44,7 +44,7 @@ const getErrorResponse = (error, fullUrl) => {
|
||||
header: {
|
||||
'Content-Type': 'text/html; charset=utf-8',
|
||||
'Proxy-Error': true,
|
||||
'Proxy-Error-Message': error || 'null'
|
||||
'Proxy-Error-Message': error ? JSON.stringify(error) : 'null'
|
||||
},
|
||||
body: requestErrorHandler.getErrorContent(error, fullUrl)
|
||||
};
|
||||
@@ -116,7 +116,7 @@ function fetchRemoteResponse(protocol, options, reqData, config) {
|
||||
|
||||
// set origin content length into header
|
||||
resHeader['x-anyproxy-origin-content-length'] = originContentLen;
|
||||
|
||||
|
||||
// only do unzip when there is res data
|
||||
if (ifServerGzipped && originContentLen) {
|
||||
refactContentEncoding();
|
||||
|
Reference in New Issue
Block a user