Skip to content

refactor: decompose app.js into focused modules#66

Merged
luispabon merged 4 commits into
masterfrom
arch-review
Jun 17, 2026
Merged

refactor: decompose app.js into focused modules#66
luispabon merged 4 commits into
masterfrom
arch-review

Conversation

@luispabon

Copy link
Copy Markdown
Collaborator

Extract SSRF/network validation, HTTP fetching, and error handling from the 530-line app.js god-module into dedicated modules (network.js, fetcher.js, errors.js). Inline trivial logger.js. Add statusCode and toResponseBody() to FetchArticleError, eliminating the 3-function error normalization chain. app.js now ~170 lines of routing and parsing orchestration.

Extract SSRF/network validation, HTTP fetching, and error handling from
the 530-line app.js god-module into dedicated modules (network.js,
fetcher.js, errors.js). Inline trivial logger.js. Add statusCode and
toResponseBody() to FetchArticleError, eliminating the 3-function error
normalization chain. app.js now ~170 lines of routing and parsing
orchestration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread src/app.js Fixed
Comment thread src/fetcher.js Dismissed
Use static '%s' format strings instead of embedding user-controlled url
into template literals that become the first argument to console methods.
This prevents format specifiers in user input from being interpreted by
util.format.
@luispabon luispabon merged commit 0aa5db9 into master Jun 17, 2026
3 checks passed
@luispabon luispabon deleted the arch-review branch June 17, 2026 19:38
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.

2 participants