Index: src/WebRequestJsObject.cpp |
diff --git a/src/WebRequestJsObject.cpp b/src/WebRequestJsObject.cpp |
index 48a703709053895845a5bb83e4036158b9b094f9..e96ed1f6fbce4481936acd53908e5d6c301b4265 100644 |
--- a/src/WebRequestJsObject.cpp |
+++ b/src/WebRequestJsObject.cpp |
@@ -56,9 +56,18 @@ namespace |
throw std::runtime_error("Third argument to GET must be a function"); |
} |
+ AdblockPlus::ServerResponse NotAllowedResponse() |
+ { |
+ AdblockPlus::ServerResponse result; |
+ result.status = AdblockPlus::WebRequest::NS_ERROR_CONNECTION_REFUSED; |
+ result.responseStatus = 0; |
+ return result; |
+ } |
+ |
void Run() |
{ |
- AdblockPlus::ServerResponse result = jsEngine->GetWebRequest()->GET(url, headers); |
+ AdblockPlus::ServerResponse result = jsEngine->IsConnectionAllowed() ? |
+ jsEngine->GetWebRequest()->GET(url, headers) : NotAllowedResponse(); |
AdblockPlus::JsContext context(jsEngine); |