[openstreetmap/openstreetmap-website] Don't rely on /query page receiving correct lat/lon parameters (PR #3833)

Anton Khorev notifications at github.com
Thu Dec 8 12:43:44 UTC 2022


If you open the empty query page https://www.openstreetmap.org/query , you'll get [javascript errors](https://github.com/openstreetmap/openstreetmap-website/issues/3819#issuecomment-1341369521). Maybe it's not supposed to be accessible this way, but there's no 404 for missing parameters. You can also pass invalid lat/lon parameters that Leaflet won't recognize and won't construct a valid LatLng object. Leaflet may fail by throwing an exception or by returning `undefined`.

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/3833

-- Commit Summary --

  * Don't set map view, don't run overpass query when no lat/lon provided to query page
  * Don't set map view, don't run overpass query when invalid lat/lon provided to query page

-- File Changes --

    M app/assets/javascripts/index/query.js (9)
    M test/system/index_test.rb (12)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/3833.patch
https://github.com/openstreetmap/openstreetmap-website/pull/3833.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3833
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/3833 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221208/cbfe448b/attachment.htm>


More information about the rails-dev mailing list