Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS Instrument only records the final request in a redirect chain #1020

Open
englehardt opened this issue Jan 12, 2023 · 0 comments · May be fixed by #1021
Open

DNS Instrument only records the final request in a redirect chain #1020

englehardt opened this issue Jan 12, 2023 · 0 comments · May be fixed by #1021
Assignees
Labels

Comments

@englehardt
Copy link
Collaborator

Originally reported in #989, but I noticed it myself while playing around with some crawl data recently. The problem stems from the listener we're using to record DNS entries.

/*
* Attach handlers to event listeners
*/
this.onCompleteListener = (details: WebRequestOnCompletedEventDetails) => {
// Ignore requests made by extensions
if (requestStemsFromExtension(details)) {
return;
}
const pendingResponse = this.getPendingResponse(details.requestId);
pendingResponse.resolveOnCompletedEventDetails(details);
this.onCompleteDnsHandler(details, crawlID);
};
browser.webRequest.onCompleted.addListener(this.onCompleteListener, filter);
}

The onCompleted event is only fired after redirects are resolved. Instead, we want to use an event that is part of the redirect loop. e.g., onHeadersReceived. I tested this and it works well, but I still need to add some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant