]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/server/falcon/server.py
disallow category tokens in the middle of a query string
[nominatim.git] / nominatim / server / falcon / server.py
index 5ec418a6f3b4aa5ad4c1f287506cb843b3b03504..00036795ae67b80f5c89726559bdd9860abb0dcb 100644 (file)
@@ -10,6 +10,7 @@ Server implementation using the falcon webserver framework.
 from typing import Optional, Mapping, cast, Any, List
 from pathlib import Path
 import datetime as dt
+import asyncio
 
 from falcon.asgi import App, Request, Response
 
@@ -164,6 +165,8 @@ def get_application(project_dir: Path,
               middleware=middleware)
     app.add_error_handler(HTTPNominatimError, nominatim_error_handler)
     app.add_error_handler(TimeoutError, timeout_error_handler)
+    # different from TimeoutError in Python <= 3.10
+    app.add_error_handler(asyncio.TimeoutError, timeout_error_handler)
 
     legacy_urls = api.config.get_bool('SERVE_LEGACY_URLS')
     for name, func in api_impl.ROUTES: