Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ self.__bx_behaviors.selectMainBehavior();
try {
const { fetched, mime, ts } = await timedRun(
directFetchCapture({ url, headers: this.headers, cdp }),
FETCH_TIMEOUT_SECS,
this.params.timeout,
"Direct fetch capture attempt timed out",
logDetails,
"fetch",
Expand Down
4 changes: 3 additions & 1 deletion src/util/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,10 @@ export class Recorder {

// if contentLength is large or unknown, do streaming, unless its an essential resource
// in which case, need to do a full fetch either way
// don't count non-200 responses which may not have content-length
if (
(contentLen < 0 || contentLen > MAX_BROWSER_DEFAULT_FETCH_SIZE) &&
responseStatusCode === 200 &&
!this.isEssentialResource(reqresp.resourceType, mimeType)
) {
const opts: ResponseStreamAsyncFetchOptions = {
Expand Down Expand Up @@ -1030,7 +1032,7 @@ export class Recorder {
}

isEssentialResource(resourceType: string | undefined, contentType: string) {
if (["document", "stylesheet", "script"].includes(resourceType || "")) {
if (resourceType === "script" || resourceType === "stylesheet") {
return true;
}

Expand Down
Loading