Skip to content

fix(http): handle empty/non-JSON success bodies - #1

Open
tmcfarlane wants to merge 1 commit into
MendleM:mainfrom
tmcfarlane:fix/index-now-empty-body
Open

fix(http): handle empty/non-JSON success bodies#1
tmcfarlane wants to merge 1 commit into
MendleM:mainfrom
tmcfarlane:fix/index-now-empty-body

Conversation

@tmcfarlane

Copy link
Copy Markdown

IndexNow and Bing return 200/202 with an empty body on accept, which caused index_now to surface "Unexpected end of JSON input" even though the URL submission succeeded. Wrap res.json() in a try/catch and return an empty success envelope when the body cannot be parsed.

Also bumps two stale "0.4.0" version strings in format-response.ts to match the current 0.9.1 in package.json (status output and error footer).

IndexNow and Bing return 200/202 with an empty body on accept, which
caused `index_now` to surface "Unexpected end of JSON input" even though
the URL submission succeeded. Wrap `res.json()` in a try/catch and
return an empty success envelope when the body cannot be parsed.

Also bumps two stale "0.4.0" version strings in format-response.ts to
match the current 0.9.1 in package.json (status output and error footer).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant