Repository navigation
Respond 400 from /api/fetchUrl instead of hanging - #339
Merged
Merged
Conversation
A url that isn't a single string (url[]=… or a repeated url param) and an unsuccessful scrape both returned without sending a response. Fixes codex-team#338 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
neSpecc
approved these changes
Nov 16, 2026
neSpecc
left a comment
Member
There was a problem hiding this comment.
Increment a patch version please
There was a problem hiding this comment.
🟡 Changes recommended
The new REST tests import a nonexistent server module, causing module-loading failures before they can exercise the regression.
What changed in this PR
This PR addresses #338 by making /api/fetchUrl respond with HTTP 400 and { success: 0 } instead of hanging on invalid URL parameters or unsuccessful scrape results.
Changes:
- Reject non-string URL parameters alongside missing URLs.
- Send a response when the scraper reports an unsuccessful result.
- Add regression tests for missing and array-valued URL parameters.
| File | Description |
|---|---|
src/test/rest/links.ts |
Adds response assertions for missing and array-valued URLs. |
src/backend/routes/api/links.ts |
Returns HTTP 400 for non-string URLs and unsuccessful scrape results. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Note 🤖 Claude Opus 5.5 responding on behalf of thegruber Bumped to 2.3.4. |
neSpecc
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #338.
/api/fetchUrlreturned without sending anything whenurlwasn't a single string (?url[]=…or?url=a&url=b), and again when the scrape came back unsuccessful, so the request just hung. Both now answer400with{ success: 0 }, same as the missing-url case. Version bumped to 2.3.4.src/test/rest/links.tsmounts the links router on a bare Express app and covers the missing and array cases. Run on Node 18 withts-mocha -n loader=ts-node/esm src/test/rest/links.ts: 2 passing; against main the array case times out.🤖 Generated with Claude Code