fix: reject out-of-range coordinates in Google text search

Adapt the coordinate bounds check contributed in public PR #46 to the Places provider.
This commit is contained in:
Prajwal Raj authored and Sameh Khamis committed 2026-09-12 16:33:51 -07:00
1 parent 8bcf1460fc
commit 3b19af4076
1 file changed
+2 -1
+2 -1
View File
@@ -183,7 +183,8 @@ export function googlePlacesContextProxy({
if (
!textQuery ||
!Number.isFinite(latitude) ||
!Number.isFinite(longitude)
!Number.isFinite(longitude) ||
latitude < -90 || latitude > 90 || longitude < -180 || longitude > 180
) {
res.statusCode = 400;
res.setHeader('Content-Type', 'application/json');