mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
add rate limit option for sessionserver
any outgoing requests to the sessionserver that would exceed the configured rate limit are skipped to prevent being blocked by CloudFront if a texture hash is cached but outdated, the cache ttl will be bumped as if the request succeeded, in order to lower requests in the near future
This commit is contained in:
12
test/test.js
12
test/test.js
@@ -695,6 +695,18 @@ describe("Crafatar", function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("CloudFront rate limit is handled", function(done) {
|
||||
var original_rate_limit = config.server.sessions_rate_limit;
|
||||
config.server.sessions_rate_limit = 1;
|
||||
networking.get_profile(rid(), uuid, function() {
|
||||
networking.get_profile(rid(), uuid, function(err, profile) {
|
||||
assert.strictEqual(err.code, "RATELIMIT");
|
||||
config.server.sessions_rate_limit = original_rate_limit;
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
after(function(done) {
|
||||
|
||||
Reference in New Issue
Block a user