-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Browser: Don't skip handling local requests #5168
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -558,15 +558,16 @@ func (m *NetworkManager) onRequest(event *network.EventRequestWillBeSent, | |
| m.logger.Errorf("NetworkManager", "creating request: %s", err) | ||
| return | ||
| } | ||
| // Skip data and blob URLs, since they're internal to the browser. | ||
| if isInternalURL(req.url) { | ||
| m.logger.Debugf("NetworkManager", "skipping request handling of %s URL", req.url.Scheme) | ||
| return | ||
| } | ||
|
|
||
| m.reqsMu.Lock() | ||
| m.reqIDToRequest[event.RequestID] = req | ||
| m.reqsMu.Unlock() | ||
| m.emitRequestMetrics(req) | ||
|
|
||
| // Skip data and blob URLs, since they're internal to the browser. | ||
| if !isInternalURL(req.url) { | ||
| m.emitRequestMetrics(req) | ||
| } | ||
|
Comment on lines
+566
to
+569
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I don't know, because I lack the historical context from the original PR, is: do we want to skip handling local requests at all, or only to not emit metrics for those requests? Because with the former, k6 differs from Playwright behavior, in the sense that if a request is supposed to fail, like: While, with the changeset suggested here, the error would be surfaces, as with PW+Chrome, while we would still not emit request metrics for those URLs. |
||
|
|
||
| m.frameManager.requestStarted(req) | ||
|
|
||
| m.eventInterceptor.onRequest(req) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course this would break
TestURLSkipRequest, as that test is precisely preventing regressions on these lines.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably this would be a breaking change, so we might need to consider carefully, and perhaps leave it up to k6 v2.0, if we really want to ship it.