We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 505aa17 commit d984b3cCopy full SHA for d984b3c
src/keri/app/contacting.ts
@@ -192,6 +192,14 @@ export class Challenges {
192
said: said,
193
};
194
const res = await this.client.fetch(path, method, data);
195
- return await res.json() as Operation<any>;
+ // Check for empty response
196
+ if (res.status === 204 || res.headers.get('content-length') === '0') {
197
+ return {} as Operation<any>;
198
+ }
199
+ const text = await res.text();
200
+ if (!text) {
201
202
203
+ return JSON.parse(text) as Operation<any>;
204
}
205
0 commit comments