@@ -687,4 +687,28 @@ describe('api', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should refuse a query on a blocked Url', function(done) {
|
||||
this.timeout(5000);
|
||||
|
||||
request({
|
||||
method: 'POST',
|
||||
url: serverUrl + '/api/runs',
|
||||
body: {
|
||||
url: 'http://www.test.com/something.html',
|
||||
waitForResponse: false
|
||||
},
|
||||
json: true,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': Object.keys(config.authorizedKeys)[0]
|
||||
}
|
||||
}, function(error, response, body) {
|
||||
if (!error && response.statusCode === 403) {
|
||||
done();
|
||||
} else {
|
||||
done(error || response.statusCode);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Vendored
+4
-1
@@ -8,5 +8,8 @@
|
||||
"1234567890": "contact@gaelmetais.com"
|
||||
},
|
||||
"maxAnonymousRunsPerDay": 10,
|
||||
"maxAnonymousCallsPerDay": 1000
|
||||
"maxAnonymousCallsPerDay": 1000,
|
||||
"blockedUrls": [
|
||||
"http://www.test.com"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user