]> git.openstreetmap.org Git - rails.git/commitdiff
Disallow changesets query with both time and order=oldest
authorAnton Khorev <tony29@yandex.ru>
Tue, 15 Aug 2023 15:40:49 +0000 (18:40 +0300)
committerAnton Khorev <tony29@yandex.ru>
Tue, 15 Aug 2023 16:29:06 +0000 (19:29 +0300)
app/controllers/api/changesets_controller.rb

index 8a1b9f55bc779993d296f823afb286976becd98c..2f397b70617043cd613d4d0fe4077c0795eef0e7 100644 (file)
@@ -157,6 +157,8 @@ module Api
     ##
     # query changesets by bounding box, time, user or open/closed status.
     def query
     ##
     # query changesets by bounding box, time, user or open/closed status.
     def query
+      raise OSM::APIBadUserInput, "cannot use order=oldest with time" if params[:time] && params[:order] == "oldest"
+
       # find any bounding box
       bbox = BoundingBox.from_bbox_params(params) if params["bbox"]
 
       # find any bounding box
       bbox = BoundingBox.from_bbox_params(params) if params["bbox"]