getaddress: send User-Agent to Nominatim

This commit is contained in:
2024-11-11 11:09:49 +00:00
parent 3fbe3fb025
commit dc723f7941
4 changed files with 30 additions and 11 deletions
+5 -1
View File
@@ -33,7 +33,11 @@ export const getAddress = async (params) => {
let coord = props.location[0].loc.coordinates
let url = NOMINATIM_URL.replace('xx', coord[1]).replace('yy', coord[0])
try {
const response = await axios(encodeURI(url));
const response = await axios(encodeURI(url),{
headers: {
'User-Agent': 'Firefox 132.0.1'
}
});
if (response.status !== 200) {
return returnOnError(ret, 'RESPSTATUS', getAddress.name, response.status)
}