mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
bug 1606818: remote: use nsIHttpServer for unregistering handler r=remote-protocol-reviewers,whimboo
nsIHttpServer.registerPathHandler() is designed to take null as the second argument to unregister path handlers. This saves us from having to modify its internal state, and fixes a minor TODO in the remote agent initialisation code. Differential Revision: https://phabricator.services.mozilla.com/D58605 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4ff0799afe
commit
9444fa34c7
@ -76,9 +76,7 @@ class RemoteAgentClass {
|
||||
this.server.registerPathHandler(target.path, target);
|
||||
});
|
||||
this.targets.on("target-destroyed", (eventName, target) => {
|
||||
// TODO: removes the entry added by registerPathHandler,
|
||||
// but we should instead have nsIHttpServer.unregisterPathHandler
|
||||
delete this.server._handler._overridePaths[target.path];
|
||||
this.server.registerPathHandler(target.path, null);
|
||||
});
|
||||
|
||||
return this.asyncListen(host, port);
|
||||
|
Loading…
Reference in New Issue
Block a user