0

I have a Laravel-made API running in a server and an Angular application running in another server. My Angular app loads a huge JSON file (with more than 500 lines) and tries to insert each line in a database through the api. A request is sent for each line, so I get an 409 error (too many requests).

I know this is a matter of security, so I don't want to remove the throttle from my middlewareGroup array in Kernel.php. I'd like to know, however, if there's any chance I can turn this rate limit down for a specific origin address (http://www.myangularapp.com/ only, for example)? So I can send these various requests while keeping the rate limit for other origin addresses.

Thanks in advance!

user3010474
  • 23
  • 1
  • 5
  • Yes you can. Just extend the existing ThrottleRequests middleware and add an exception list or higher rate for selected routes. Then replace the old throttle middleware with your custom one. – Sandeesh Jun 02 '17 at 15:59
  • That's it! I wish I could make this comment the answer of this question. – user3010474 Jun 09 '17 at 20:44

0 Answers0