shogun-relay-sdk 1.2.6 → 1.2.7

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.
@@ -74,9 +74,14 @@ class IpfsModule {
74
74
  const encodedPath = fullPath.includes('/')
75
75
  ? `${encodeURIComponent(directoryCid)}/${filePath.split('/').map(p => encodeURIComponent(p)).join('/')}`
76
76
  : encodeURIComponent(fullPath);
77
- return this.client.post(`/api/v1/ipfs/api/v0/cat?arg=${encodedPath}`, null, {
77
+ // Use GET instead of POST, or send empty string instead of null to avoid JSON parser error
78
+ // IPFS API v0 cat accepts POST with empty body, but Express JSON parser fails on null
79
+ return this.client.post(`/api/v1/ipfs/api/v0/cat?arg=${encodedPath}`, "", // Empty string instead of null to avoid JSON parser error
80
+ {
78
81
  responseType: "arraybuffer",
79
- // Don't set Content-Length header - browser will block it
82
+ headers: {
83
+ "Content-Type": "application/octet-stream", // Set content type to avoid JSON parsing
84
+ },
80
85
  });
81
86
  }
82
87
  async pinAdd(cid) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shogun-relay-sdk",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "SDK for interacting with Shogun Relay API - HTTP client for IPFS, deals, registry, and network operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",