mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 14:33:17 +00:00
don't exclude 204s
This commit is contained in:
parent
bc201be7f1
commit
ea9639f0bd
2 changed files with 4 additions and 4 deletions
|
@ -912,7 +912,7 @@ export class Recorder {
|
||||||
}
|
}
|
||||||
|
|
||||||
async serializeToWARC(reqresp: RequestResponseInfo) {
|
async serializeToWARC(reqresp: RequestResponseInfo) {
|
||||||
if (reqresp.shouldSkip()) {
|
if (reqresp.shouldSkipSave()) {
|
||||||
const { url, method, status, payload } = reqresp;
|
const { url, method, status, payload } = reqresp;
|
||||||
logNetwork("Skipping request/response", {
|
logNetwork("Skipping request/response", {
|
||||||
url,
|
url,
|
||||||
|
|
|
@ -270,12 +270,12 @@ export class RequestResponseInfo {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldSkip() {
|
shouldSkipSave() {
|
||||||
// skip OPTIONS/HEAD responses, and 304, 204 or 206 responses
|
// skip OPTIONS/HEAD responses, and 304 or 206 responses
|
||||||
if (
|
if (
|
||||||
!this.payload ||
|
!this.payload ||
|
||||||
(this.method && ["OPTIONS", "HEAD"].includes(this.method)) ||
|
(this.method && ["OPTIONS", "HEAD"].includes(this.method)) ||
|
||||||
[204, 206, 304].includes(this.status)
|
[206, 304].includes(this.status)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue