Skip to content

Commit

Permalink
use identifying user-agent for nominatim: Prevents requests being blo…
Browse files Browse the repository at this point in the history
…cked
  • Loading branch information
hansmorb committed Jul 11, 2024
1 parent a9e9228 commit 218954c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Helper/NominatimGeoCodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ class NominatimGeoCodeService implements GeoCodeService {
* @param $addressString
*
* @return ?Location
* @throws \Exception
*/
public function getAddressData( $addressString ): ?Location {
$defaultUserAgent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0';

$defaultUserAgent = 'CommonsBooking v.' . COMMONSBOOKING_VERSION . " Contact: [email protected]";

$client = new Client(
null,
Expand Down Expand Up @@ -49,4 +51,4 @@ public function getAddressData( $addressString ): ?Location {

return null;
}
}
}

0 comments on commit 218954c

Please sign in to comment.