]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/changesets_controller.rb
Enforce rate limit for API calls which make changes
[rails.git] / app / controllers / api / changesets_controller.rb
index 7bb7a5a4de14bddb49f988f7f9285d96de074b1e..9bdf0f2bd3b075a5a5eb09e5755bfa76ee224bde 100644 (file)
@@ -92,6 +92,10 @@ module Api
       diff_reader = DiffReader.new(request.raw_post, changeset)
       Changeset.transaction do
         result = diff_reader.commit
+        # the number of changes in this changeset has already been
+        # updated and is visible in this transaction so we don't need
+        # to allow for any more when checking the limit
+        check_rate_limit(0)
         render :xml => result.to_s
       end
     end