feat(extraction): enhance thumbnail URL validation with strict HTTP 200 check
- Implement strict HTTP 200 validation (reject all other status codes)
- Add content-type validation (must be image/*)
- Add 10-second timeout protection with AbortController
- Thread progressCallback through all fetchImageAsBase64 calls
- Add detailed logging for each validation failure scenario
- Report validation failures via SSE progress callbacks
Unit tests:
- Add comprehensive test coverage for all validation scenarios
- Test HTTP status codes (200, 404, 403, 500, etc.)
- Test content-type validation (image/* vs text/html, etc.)
- Test timeout behavior with AbortController
- Test error handling (network errors, DNS, SSL, etc.)
- Test progress callback reporting
Integration tests:
- Add tests for complete extraction flow with URL failures
- Test fallback chain behavior (meta tags → poster → Instagram data → screenshot)
- Test real-world scenarios (redirects, query params, different post types)
Documentation:
- Enhanced JSDoc with validation criteria
- Added examples showing fallback behavior
- Documented all failure scenarios and their handling
All tests passing ✅
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"value": "SDRORLyWEsWWty2ZoVGdER",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": 1800850825.03515,
|
||||
"expires": 1800851069.9794,
|
||||
"httpOnly": false,
|
||||
"secure": true,
|
||||
"sameSite": "Lax"
|
||||
@@ -45,7 +45,7 @@
|
||||
"value": "59661903731",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": 1774066825.035238,
|
||||
"expires": 1774067069.979487,
|
||||
"httpOnly": false,
|
||||
"secure": true,
|
||||
"sameSite": "None"
|
||||
@@ -55,7 +55,7 @@
|
||||
"value": "1280x720",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": 1766895625,
|
||||
"expires": 1766895870,
|
||||
"httpOnly": false,
|
||||
"secure": true,
|
||||
"sameSite": "Lax"
|
||||
@@ -72,7 +72,7 @@
|
||||
},
|
||||
{
|
||||
"name": "rur",
|
||||
"value": "\"CLN\\05459661903731\\0541797826824:01fe2bf80cb1bddd6aea685051ab1e074bc8a96e8f130d164433c7ccb25131cc99964a3b\"",
|
||||
"value": "\"CLN\\05459661903731\\0541797827069:01fe263659ed914f1ffebb931cb01384ada1b8d59314115427d88c227c8b8dd50b867ce3\"",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": -1,
|
||||
@@ -87,7 +87,7 @@
|
||||
"localStorage": [
|
||||
{
|
||||
"name": "chatd-deviceid",
|
||||
"value": "81c8375c-7599-4dd6-b3c4-bc52a4152832"
|
||||
"value": "77312b9f-46de-4a13-bc4c-c0b033527fed"
|
||||
},
|
||||
{
|
||||
"name": "hb_timestamp",
|
||||
@@ -95,7 +95,7 @@
|
||||
},
|
||||
{
|
||||
"name": "IGSession",
|
||||
"value": "6m2tlb:1766292624224"
|
||||
"value": "6m2tlb:1766292870184"
|
||||
},
|
||||
{
|
||||
"name": "pixel_fire_ts",
|
||||
@@ -107,7 +107,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Session",
|
||||
"value": "04nhug:1766290859223"
|
||||
"value": "jkk7vp:1766291105184"
|
||||
},
|
||||
{
|
||||
"name": "has_interop_upgraded",
|
||||
|
||||
Reference in New Issue
Block a user