Remove strict_slashes for /

I don't know why, but on my setup (nginx + uwsgi), the `strict_slashes` (default to `True`) was causing an infinite loop.
I think it could be safely removed for this route only.
This commit is contained in:
Glandos 2018-07-11 13:23:56 +02:00 committed by Alexis Métaireau
parent 633e3543b2
commit c1b5eb1375
3 changed files with 8 additions and 1 deletions

View file

@ -13,6 +13,7 @@ Fixed
- Fix broken install with pip ≥ 10 (#340)
- Fix the generation of the supervisord template (#309)
- Fix the validation of the hashed password (#310)
- Fix infinite loop that happened when accessing / (#358)
Added
=====

View file

@ -1434,6 +1434,12 @@ class APITestCase(IhatemoneyTestCase):
class ServerTestCase(IhatemoneyTestCase):
def test_homepage(self):
# See https://github.com/spiral-project/ihatemoney/pull/358
self.app.config['APPLICATION_ROOT'] = '/'
req = self.client.get("/")
self.assertStatus(200, req)
def test_unprefixed(self):
self.app.config['APPLICATION_ROOT'] = '/'
req = self.client.get("/foo/")

View file

@ -198,7 +198,7 @@ def authenticate(project_id=None):
return render_template("authenticate.html", form=form)
@main.route("/")
@main.route("/", strict_slashes=False)
def home():
project_form = ProjectForm()
auth_form = AuthenticationForm()