You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, backtracked it to
swsCoreStats.js line 211
resContentLength = res['_contentLength']; // doesn't check if it's null. Can add a check if res._contentLength is null, it will jump to taking the value from the header.
}else{
// Try header
if(res.hasHeader('content-length')) {
resContentLength = res.getHeader('content-length');
}
}```
swsAPIstats.js
Error thrown at line 513
this.promClientMetrics.api_response_size_bytes.labels(req.method,req.sws.api_path,res.statusCode).observe( req.sws.res_clength ? req.sws.res_clength : 0 );
if(req.sws.res_clength) = null. if response.c_length = 0;
Propagated from all the way from response intercept.
FIX
this.promClientMetrics.api_response_size_bytes.labels(req.method,req.sws.api_path,res.statusCode).observe( req.sws.res_clength ? req.sws.res_clength : 0 );
added a ternary operator to fix the issue.
Let me know if this is an actual bug, will submit a PR.
The text was updated successfully, but these errors were encountered: