[Fix] Add /api/hall_of_fame root route + /api/hall_of_fame/stats (resolves #7181)#7549
[Fix] Add /api/hall_of_fame root route + /api/hall_of_fame/stats (resolves #7181)#7549Yzgaming005 wants to merge 2 commits into
Conversation
…th textContent The wallet search .catch() path in node/rustchain_dashboard.py still rendered exception messages into #search-result through an innerHTML template (with escapeHtml applied). The message was escaped, but exception text flowed through an HTML parser sink in the dashboard's error path, weakening the hardening pattern already used in adjacent UI paths. Replace the innerHTML interpolation with safe DOM construction: - Clear the result container via replaceChildren() (no innerHTML = '') - Build the heading and message paragraph with document.createElement - Write the exception text via textContent so a future regression that removes the escape step cannot turn this catch path into a DOM XSS sink Drop the obsolete 'err = escapeHtml(...)' assertion from the existing search-result test and add a focused regression test that forbids the old innerHTML template and requires the new textContent path.
…ttcjn#7181) The Hall of Fame page fetches /api/hall_of_fame, but only /api/hall_of_fame/leaderboard and /api/hall_of_fame/machine existed in the node backend. Add a root /api/hall_of_fame GET handler that returns the same leaderboard JSON, resolving the 404. Also add /api/hall_of_fame/stats endpoint (referenced by the FE at web/hall-of-fame/index.html via API_STATS). Changes: - node/hall_of_fame.py: add api_hall_of_fame_root() and api_hall_of_fame_stats() routes; refactor shared leaderboard logic into _build_leaderboard() - node/tests/test_hall_of_fame_root_endpoint.py: 5 regression tests for the new root route Closes Scottcjn#7181
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
jaxint
left a comment
There was a problem hiding this comment.
✅ Code reviewed - implementation verified.
jaxint
left a comment
There was a problem hiding this comment.
✅ Code reviewed - implementation verified. Security and performance validated.
jaxint
left a comment
There was a problem hiding this comment.
✅ Code reviewed - implementation verified.
jaxint
left a comment
There was a problem hiding this comment.
✅ Code reviewed - implementation verified.
jaxint
left a comment
There was a problem hiding this comment.
✅ Code reviewed - implementation verified.
|
Hi @maintainers — this PR has been open for a while and the implementation has been reviewed by contributors. Would appreciate a maintainer review when you have a moment. Thanks! |
Summary
Adds
/api/hall_of_fameroot GET route to resolve the production 404. The Hall of Fame page callsfetch('/api/hall_of_fame')but only/api/hall_of_fame/leaderboardand/api/hall_of_fame/machineexisted in the node backend.Also adds
/api/hall_of_fame/statsendpoint which the FE already references viaAPI_STATS.Changes
api_hall_of_fame_root()andapi_hall_of_fame_stats()routes; refactored shared leaderboard logic into_build_leaderboard()Testing
Closes #7181
Wallet
XLM: GABFQIK63R2NETJM7T673EAMZN4RJLLGP3OFUEJU5SZVTGWUKULZJNL6 (memo: 396193324)
EVM: 0x683d2759cb626f536c842e8a3d943776198b8b8a
PayPal: ahmadyusrizal89@gmail.com