web-check/api
Sid a163c356b9 fix: handle non-JSON responses in carbon.js to prevent crash
When the WebsiteCarbon API is protected by Cloudflare and requests
originate from datacenter IPs, Cloudflare may return an HTML challenge
page instead of JSON. This caused JSON.parse() to throw an uncaught
SyntaxError exception, crashing the entire application.

This fix:
- Checks if the response starts with HTML markers before parsing
- Wraps JSON.parse in try-catch for additional safety
- Returns a descriptive error message instead of crashing

Fixes #268
2026-01-08 21:54:20 +05:30
..
_common feat: Temporarily disable, because I am poor. 2024-12-17 20:16:36 +00:00
archives.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
block-lists.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
carbon.js fix: handle non-JSON responses in carbon.js to prevent crash 2026-01-08 21:54:20 +05:30
cookies.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
dns-server.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
dns.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
dnssec.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
features.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
firewall.js Merge branch 'master' of github.com:lissy93/web-check into FEAT/astroify 2024-06-16 21:18:41 +01:00
get-ip.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
headers.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
hsts.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
http-security.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
legacy-rank.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
linked-pages.js JSON parsing in API endpoints 2024-05-18 15:01:52 +01:00
mail-config.js JSON parsing in API endpoints 2024-05-18 15:01:52 +01:00
ports.js adds ports to check environment variable. 2025-08-01 08:27:15 +02:00
quality.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
rank.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
redirects.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
robots-txt.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
screenshot.js security: Replace exec with execFile 2025-04-12 12:11:11 +01:00
security-txt.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
sitemap.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
social-tags.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
ssl.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
status.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
tech-stack.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
threats.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
tls.js JSON parsing in API endpoints 2024-05-18 15:01:52 +01:00
trace-route.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
txt-records.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00
whois.js Convert all API endpoints into ESM modules 2024-05-06 21:51:32 +01:00