Get rid of check for target path length on target-created
Categories
(Remote Protocol :: Agent, task, P1)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: ato, Assigned: ato)
References
Details
(Whiteboard: [puppeteer-alpha-reserve])
Attachments
(2 files)
When target-created
is handled we check explicitly that it’s URL path is not empty:
this.targets.on("target-created", (eventName, target) => {
if (!target.path) {
throw new Error(`Target is missing 'path' attribute: ${target}`);
}
this.server.registerPathHandler(target.path, target);
});
It should be illegal in nsIHttpServer.registerPathHandler
to register a path
on an empty string because it cannot later be accessed or referenced, i.e. deleted.
It also blocks bug 1590828 because we cannot error in async code.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
It should be illegal to add paths that cannot be handled/accessed
or later referenced. Without a path, it is for example later
impossible to delete the handler.
To address this we return an NS_ERROR_INVALID_ARG when
nsIHttpServer.registerPathHandler is called with an empty string.
Assignee | ||
Comment 2•6 years ago
|
||
As nsIHttpServer.registerPathHandler now checks that the path is
not empty we can drop our pre-check when target-created is handled.
If target.path does happen to be empty an error is printed to the console.
Comment 4•6 years ago
|
||
bugherder |
Description
•