From b6c2e7ef768c542308cd06ecaee56382134b205d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 27 Aug 2014 21:05:54 +0800 Subject: [PATCH] Ignore requests to other hosts. --- atom/browser/lib/chrome-extension.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/browser/lib/chrome-extension.coffee b/atom/browser/lib/chrome-extension.coffee index 3a62da5..6ca1bc1 100644 --- a/atom/browser/lib/chrome-extension.coffee +++ b/atom/browser/lib/chrome-extension.coffee @@ -8,7 +8,7 @@ hostPathMap = {} hostPathMapNextKey = 0 getHostForPath = (path) -> - key = "extension-#{hostPathMapNextKey}" + key = "extension-#{++hostPathMapNextKey}" hostPathMap[key] = path key @@ -23,6 +23,8 @@ app.once 'ready', -> parsed = url.parse request.url return unless parsed.hostname and parsed.path? + return unless /extension-\d+/.test parsed.hostname + directory = getPathForHost parsed.hostname return new protocol.RequestFileJob(path.join(directory, parsed.path)) -- 2.7.4