@zenrows/mcp 2.0.1 → 2.0.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.
package/dist/http.js CHANGED
@@ -72,6 +72,7 @@ app.all("/browser/*", async (c) => {
72
72
  method: c.req.method,
73
73
  headers: c.req.raw.headers,
74
74
  body: c.req.raw.body,
75
+ duplex: "half",
75
76
  });
76
77
  const res = await fetch(req);
77
78
  return new Response(res.body, { status: res.status, headers: res.headers });
@@ -12,7 +12,8 @@ export async function browserFetch(method, path, apiKey, browserUrl, body) {
12
12
  const response = await fetch(url, init);
13
13
  let data;
14
14
  const contentType = response.headers.get("content-type") ?? "";
15
- data = contentType.includes("application/json") ? await response.json() : await response.text();
15
+ const text = await response.text();
16
+ data = contentType.includes("application/json") && text ? JSON.parse(text) : text;
16
17
  return { ok: response.ok, status: response.status, data };
17
18
  }
18
19
  export function browserError(result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenrows/mcp",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "ZenRows MCP server — Universal Scraper API for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {