Browse Source

increased length rate limit is in effect for

Henry Oswald 11 năm trước cách đây
mục cha
commit
ba58509a67

+ 2 - 2
services/web/app/coffee/Features/Compile/CompileController.coffee

@@ -50,9 +50,9 @@ module.exports = CompileController =
 			else
 			else
 				rateLimitOpts =
 				rateLimitOpts =
 					endpointName: "full-pdf-download"
 					endpointName: "full-pdf-download"
-					throttle: 50
+					throttle: 100
 					subjectName : req.ip
 					subjectName : req.ip
-					timeInterval : 60 * 5
+					timeInterval : 60 * 10
 				RateLimiter.addCount rateLimitOpts, callback
 				RateLimiter.addCount rateLimitOpts, callback
 
 
 		Project.findById project_id, {name: 1}, (err, project)->
 		Project.findById project_id, {name: 1}, (err, project)->

+ 1 - 0
services/web/app/coffee/Features/Subscription/SubscriptionController.coffee

@@ -9,6 +9,7 @@ Settings   = require 'settings-sharelatex'
 logger     = require('logger-sharelatex')
 logger     = require('logger-sharelatex')
 GeoIpLookup = require("../../infrastructure/GeoIpLookup")
 GeoIpLookup = require("../../infrastructure/GeoIpLookup")
 SubscriptionDomainHandler = require("./SubscriptionDomainHandler")
 SubscriptionDomainHandler = require("./SubscriptionDomainHandler")
+require("../../infrastructure/Sixpack")
 
 
 module.exports = SubscriptionController =
 module.exports = SubscriptionController =
 
 

+ 2 - 2
services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee

@@ -135,7 +135,7 @@ describe "CompileController", ->
 				@req.query = {}
 				@req.query = {}
 				@RateLimiter.addCount.callsArgWith(1, null, true)
 				@RateLimiter.addCount.callsArgWith(1, null, true)
 				@CompileController.proxyToClsi = (project_id, url)=>
 				@CompileController.proxyToClsi = (project_id, url)=>
-					@RateLimiter.addCount.args[0][0].throttle.should.equal 50
+					@RateLimiter.addCount.args[0][0].throttle.should.equal 100
 					done()
 					done()
 				@CompileController.downloadPdf @req, @res
 				@CompileController.downloadPdf @req, @res
 
 
@@ -144,7 +144,7 @@ describe "CompileController", ->
 				@req.query = {pdfng:false}
 				@req.query = {pdfng:false}
 				@RateLimiter.addCount.callsArgWith(1, null, true)
 				@RateLimiter.addCount.callsArgWith(1, null, true)
 				@CompileController.proxyToClsi = (project_id, url)=>
 				@CompileController.proxyToClsi = (project_id, url)=>
-					@RateLimiter.addCount.args[0][0].throttle.should.equal 50
+					@RateLimiter.addCount.args[0][0].throttle.should.equal 100
 					done()
 					done()
 				@CompileController.downloadPdf @req, @res
 				@CompileController.downloadPdf @req, @res