@riddl/core 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/adapters.js +3 -6
  2. package/package.json +1 -1
package/dist/adapters.js CHANGED
@@ -62,12 +62,9 @@ export const setResponse = async (res, response) => {
62
62
  };
63
63
  export const rawAdapter = (apiHandler) => (async (req, res) => {
64
64
  const response = await apiHandler(toFetchRequest(req));
65
- res.statusCode = response.status;
66
- res.setHeader("Content-Type", "application/json");
67
- res.setHeader("Content-Length", "0");
68
- response.headers.forEach((value, key) => {
69
- res.setHeader(key, value);
70
- });
65
+ // Delegate entirely to setResponse. Do not preset Content-Length: 0 or
66
+ // Content-Type: application/json — that breaks SSE and other streaming
67
+ // bodies whose Response omits content-length (chunked transfer).
71
68
  await setResponse(res, response);
72
69
  });
73
70
  export const expressAdapter = (apiHandler) => express.Router().use(rawAdapter(apiHandler));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddl/core",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {