ntohidi
0eaa9f9895
fix: handle infinity values in JSON serialization for API responses
- Add sanitize_json_data() function to convert infinity/NaN to JSON-compliant strings
- Fix /execute_js endpoint returning ValueError: Out of range float values are not JSON compliant: inf
- Fix /crawl endpoint batch responses with infinity values
- Fix /crawl/stream endpoint streaming responses with infinity values
- Fix /crawl/job endpoint background job responses with infinity values
The sanitize_json_data() function recursively processes response data:
- float('inf') → \"Infinity\"
- float('-inf') → \"-Infinity\"
- float('nan') → \"NaN\"
This prevents JSON serialization errors when JavaScript execution or crawling operations produce infinity values, ensuring all API endpoints return valid JSON.
Fixes: API endpoints crashing with infinity JSON serialization errors
Affects: /execute_js, /crawl, /crawl/stream, /crawl/job endpoints
2025-07-15 13:49:07 +02:00
..
2025-07-04 15:16:53 +08:00
2025-06-10 18:08:27 +08:00
2025-06-23 10:44:27 +08:00
2025-03-31 21:55:07 +08:00
2025-02-10 16:58:52 +08:00
2025-06-09 11:49:33 +08:00
2025-07-15 13:49:07 +02:00
2025-07-09 09:41:03 +02:00
2025-02-07 21:56:27 +08:00
2025-02-28 19:53:35 +08:00
2025-04-22 22:35:25 +08:00
2025-04-21 22:22:02 +08:00
2025-04-29 23:04:32 +08:00
2025-07-11 22:27:18 +08:00
2024-05-14 21:27:41 +08:00
2025-04-29 16:26:35 +02:00
2025-01-13 19:19:58 +08:00
2025-04-29 16:26:35 +02:00
2025-06-27 21:54:22 +08:00
2025-01-13 19:19:58 +08:00
2025-04-29 16:26:35 +02:00
2025-05-19 13:51:16 +08:00
2025-02-28 19:53:35 +08:00
2025-06-29 20:41:37 +08:00
2025-06-10 18:08:27 +08:00