Forward & Reverse Geocoding

फ्रीमियम
Verified
द्वारा Geocoding | अपडेट किया गया 21 days ago | Mapping
लोकप्रियता

9.9 / 10

लेटेंसी

92ms

सेवा का स्तर

100%

Health Check

100%

सभी चर्चाओं पर वापस जाएं

Bug: Request with empty query parameter

When using geocoding search I am able to send empty string for the parameter ‘q’ even though it’s required.
The URL used is: https://forward-reverse-geocoding.p.rapidapi.com/v1/search?q=&addressdetails=1&limit=1
As a result I get this Object:
{
“lat”: “52.720615499999994”,
“lon”: “58.66574618108943”,
“displayName”: “Sibay, городской округ Сибай, Baschkortostan, Föderationskreis Wolga, UNDEFINED, Russland”
}
(It’s in German, but yeah, it’s somewhere in Russia)

Rapid account: Geocode Support
GeocodeSupport Commented a year ago

Yes, so it’s best to first check if your variable for q (or any other field in the query) is not empty|undefined|null|none etc. (depending on the language used).

Rapid account: Andreas Pradel Caruso
AndreasPradelCaruso Commented a year ago

Ah, then it looks like the Angular HTTP Client automatically adds “undefined” to URLs when it detects an empty parameter. Good to know!
Also thanks for pointing it out, I printed the URL into my console before I gave it to the HTTP Client and there it didn’t contain “undefined”.

Rapid account: Geocode Support
GeocodeSupport Commented a year ago

Hi Andreas, this did not happen with an empty string for q, but with a string of “undefined” (which is not undefined but just a string with the value “undefined”).

So you searched for https://forward-reverse-geocoding.p.rapidapi.com/v1/search?q=undefined&addressdetails=1&limit=1

Now “undefined” should be a stop word but currently is not (these are always hard edge cases, e.g. how would you treat a store that is called “Undefined”? We do have the same edge case with “null”).

If you do send an empty string for q at the search endpoint, you won’t get a result.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें