From 28d2dc98cdd66c14566f48368a6fc3e2a373f4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Cant=C3=B9?= Date: Tue, 21 Nov 2023 14:22:33 +0100 Subject: [PATCH] disable trailing slashes --- config/settings/base.py | 1 + metadata_catalogue/datasets/geoapi/urls.py | 26 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 015b676..fae8945 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -326,3 +326,4 @@ # Minutes that GEOAPI should cache views and settings GEOAPI_CACHE_TIMEOUT = env.int("DJANGO_GEOAPI_CACHE_TIMEOUT", default=0) +APPEND_SLASH = False diff --git a/metadata_catalogue/datasets/geoapi/urls.py b/metadata_catalogue/datasets/geoapi/urls.py index 383fe81..704617a 100644 --- a/metadata_catalogue/datasets/geoapi/urls.py +++ b/metadata_catalogue/datasets/geoapi/urls.py @@ -8,21 +8,21 @@ urlpatterns = [ path("", views.landing_page, name="landing-page"), - path("openapi/", views.openapi, name="openapi"), - path("conformance/", views.conformance, name="conformance"), - path("collections/", views.collections, name="collections"), + path("openapi", views.openapi, name="openapi"), + path("conformance", views.conformance, name="conformance"), + path("collections", views.collections, name="collections"), path( "collections/", views.collections, name="collection-detail", ), path( - "collections//queryables/", + "collections//queryables", views.collection_queryables, name="collection-queryables", ), path( - "collections//items/", + "collections//items", views.collection_items, name="collection-items", ), @@ -32,17 +32,17 @@ name="collection-item", ), path( - "collections//coverage/", + "collections//coverage", views.collection_coverage, name="collection-coverage", ), path( - "collections//coverage/domainset/", # noqa + "collections//coverage/domainset", # noqa views.collection_coverage_domainset, name="collection-coverage-domainset", ), path( - "collections//coverage/rangetype/", # noqa + "collections//coverage/rangetype", # noqa views.collection_coverage_rangetype, name="collection-coverage-rangetype", ), @@ -57,7 +57,7 @@ name="collection-style-map", ), path( - "collections//tiles/", + "collections//tiles", views.collection_tiles, name="collection-tiles", ), @@ -137,12 +137,12 @@ views.get_collection_edr_query, name="collection-edr-instance-corridor", ), - path("processes/", views.processes, name="processes"), + path("processes", views.processes, name="processes"), path("processes/", views.processes, name="process-detail"), path("jobs/", views.jobs, name="jobs"), path("jobs/", views.jobs, name="job"), path( - "jobs//results/", + "jobs//results", views.job_results, name="job-results", ), @@ -151,9 +151,9 @@ views.job_results_resource, name="job-results-resource", ), - path("stac/", views.stac_catalog_root, name="stac-catalog-root"), + path("stac", views.stac_catalog_root, name="stac-catalog-root"), path("stac/", views.stac_catalog_path, name="stac-catalog-path"), - path("stac/search/", views.stac_catalog_search, name="stac-catalog-search"), + path("stac/search", views.stac_catalog_search, name="stac-catalog-search"), ] # Add static URLs to serve pygeoapi statics