mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
skip Nominatim lookups when the server has none configured
Add GET /api/geocode/status ({configured}), like /api/overpass/status. The outline client and the last-resort place search ask it once per page and send no lookup a server without a Nominatim endpoint would refuse, so a default install no longer logs a 503 on its first named landmark or grounds ask. An older server or a failed probe leaves the capability unknown and lookups proceed as before.
This commit is contained in:
1 parent
24228b145e
commit
f32ab5446b
10 files changed
+157
-6
No files matched your search
@@ -1235,10 +1235,15 @@ test('the outline route reports disabled and capped as permanent, busy as retrya
|
||||
assert.equal(off.status, 503);
|
||||
assert.equal(off.body.code, 'NOMINATIM_DISABLED');
|
||||
assert.equal(off.body.retryable, false);
|
||||
// The capability probe answers 200, so a client can skip the refused lookup.
|
||||
const probe = await disabled('/status');
|
||||
assert.equal(probe.status, 200);
|
||||
assert.deepEqual(probe.body, { configured: false });
|
||||
|
||||
const capped = mount({
|
||||
gate: publicGate(t, { settings: { ...PUBLIC, dailyCap: 0 } }),
|
||||
});
|
||||
assert.deepEqual((await capped('/status')).body, { configured: true });
|
||||
const cap = await capped('/outline?q=Paris&kind=city');
|
||||
assert.equal(cap.status, 429);
|
||||
assert.equal(cap.body.retryable, false);
|
||||
|
||||
Reference in new issue
Block a user