Spaces:
Sleeping
Sleeping
dandi commited on
Commit ·
763e1d1
1
Parent(s): 4e18ea2
fix: add Content-Length header explicitly
Browse files- api/lib/proxy.js +3 -1
api/lib/proxy.js
CHANGED
|
@@ -148,8 +148,10 @@ function writeResponse(clientRes, result) {
|
|
| 148 |
}
|
| 149 |
}
|
| 150 |
|
|
|
|
|
|
|
| 151 |
clientRes.status(result.status);
|
| 152 |
-
clientRes.end(
|
| 153 |
}
|
| 154 |
|
| 155 |
module.exports = { proxyToKimchi, writeResponse };
|
|
|
|
| 148 |
}
|
| 149 |
}
|
| 150 |
|
| 151 |
+
const body = result.body || "";
|
| 152 |
+
clientRes.setHeader("Content-Length", Buffer.byteLength(body));
|
| 153 |
clientRes.status(result.status);
|
| 154 |
+
clientRes.end(body);
|
| 155 |
}
|
| 156 |
|
| 157 |
module.exports = { proxyToKimchi, writeResponse };
|