Skip to content

Commit 5547d16

Browse files
remove few comments
1 parent 7b00327 commit 5547d16

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/spacecat-shared-utils/src/bot-blocker-detect/bot-blocker-detect.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ function analyzeResponse(response, html = null) {
255255
};
256256
}
257257

258-
// Could be blocked by unknown CDN/protection
258+
// Potential CDN/protection blocked the request
259259
if (status === 403) {
260260
return {
261261
crawlable: false,
@@ -265,8 +265,6 @@ function analyzeResponse(response, html = null) {
265265
};
266266
}
267267

268-
// Other client/server errors are not considered bot protection
269-
// (429 rate limiting, 401 auth, 406 content negotiation, etc. should be handled separately)
270268
return {
271269
crawlable: true,
272270
type: 'unknown',
@@ -354,10 +352,10 @@ export function analyzeBotProtection({ status, headers, html }) {
354352
? headers
355353
: new Headers(Object.entries(headers || {}));
356354

357-
const mockResponse = {
355+
const response = {
358356
status,
359357
headers: headersObj,
360358
};
361359

362-
return analyzeResponse(mockResponse, html);
360+
return analyzeResponse(response, html);
363361
}

0 commit comments

Comments
 (0)