togello-mcp-server 1.0.21 → 1.0.22

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/build/client.js +10 -3
  2. package/package.json +1 -1
package/build/client.js CHANGED
@@ -35,7 +35,12 @@ export const httpClient = {
35
35
  if (!response.ok) {
36
36
  throw new Error(`response status: ${response.status}`);
37
37
  }
38
- return (await response.json());
38
+ // 空レスポンスの堅牢な処理
39
+ const text = await response.text();
40
+ if (!text || text.trim() === '') {
41
+ return undefined;
42
+ }
43
+ return JSON.parse(text);
39
44
  },
40
45
  putJson: async ({ path, body }) => {
41
46
  const token = process.env.TOGELLO_API_TOKEN;
@@ -55,9 +60,11 @@ export const httpClient = {
55
60
  if (!response.ok) {
56
61
  throw new Error(`response status: ${response.status}`);
57
62
  }
58
- if (response.headers.get('content-length') === '0') {
63
+ // 空レスポンスの堅牢な処理
64
+ const text = await response.text();
65
+ if (!text || text.trim() === '') {
59
66
  return undefined;
60
67
  }
61
- return (await response.json());
68
+ return JSON.parse(text);
62
69
  },
63
70
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "togello-mcp-server",
4
- "version": "1.0.21",
4
+ "version": "1.0.22",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "build": "tsc && chmod 755 build/index.js",