[openstreetmap/openstreetmap-website] undefined method `split' when Nomintim isn't reachable (Issue #4137)
mtmail
notifications at github.com
Thu Aug 3 14:42:57 UTC 2023
I found the issue is a couple of lines up:
```ruby
more_url_params = CGI.parse(URI.parse(results.attributes["more_url"]).query)
```
dulcy server returns just the query part of the URL in more_url, the other server return a full URL
```
curl 'https://dulcy.openstreetmap.org/search.php?q=london&format=xml'
more_url="q=london&addressdetails=1&limit=..."
curl 'https://vhagar.openstreetmap.org/search.php?q=london&format=xml'
more_url='https://vhagar.openstreetmap.org/search.php/?q=london&exclude_p...
```
That causes the error:
```
ruby -e'require "cgi"; p CGI.parse(URI.parse("q=London").query)'
[...]/ruby/2.6.0/cgi/core.rb:384:in `parse': undefined method `split' for nil:NilClass
ruby -e'require "cgi"; p CGI.parse(URI.parse("http://example.com/search?q=London").query)'
{"q"=>["London"]}
```
Dulcy is running the next version of Nominatim, the rewrite in Python, with Python webserver. You might also notice it puts the attributes in single quotes instead of double quotes (Python XML vs PHP XML serializing library).
Adding @lonvia to ask if that's an oversight, the attribute is called 'URL' after all or meant to stay.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/4137#issuecomment-1664121873
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/4137/1664121873 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230803/32cdd12e/attachment.htm>
More information about the rails-dev
mailing list