From 1aad396c9ef46837b224607086c09f48ac921165 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 12 Dec 2017 21:32:43 -0800 Subject: [PATCH] Fixed bug with .json path regular expression I had a table called "geojson" and it caused an exception because the regex was matching .json and not \.json --- datasette/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datasette/app.py b/datasette/app.py index b810af86..e7a5ce48 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -998,7 +998,7 @@ class Datasette: self.jinja_env.filters['quote_plus'] = lambda u: urllib.parse.quote_plus(u) self.jinja_env.filters['escape_table_name'] = escape_sqlite_table_name self.jinja_env.filters['to_css_class'] = to_css_class - app.add_route(IndexView.as_view(self), '/') + app.add_route(IndexView.as_view(self), '/') # TODO: /favicon.ico and /-/static/ deserve far-future cache expires app.add_route(favicon, '/favicon.ico') app.static('/-/static/', str(app_root / 'datasette' / 'static')) @@ -1006,7 +1006,7 @@ class Datasette: app.static(path, dirname) app.add_route( DatabaseView.as_view(self), - '/' + '/' ) app.add_route( DatabaseDownload.as_view(self), @@ -1014,10 +1014,10 @@ class Datasette: ) app.add_route( TableView.as_view(self), - '//' + '//' ) app.add_route( RowView.as_view(self), - '///' + '///' ) return app