Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove strict_slashes for / #358

Closed
wants to merge 2 commits into from
Closed

Conversation

Glandos
Copy link
Member

@Glandos Glandos commented Jul 11, 2018

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.

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.
@JocelynDelalande
Copy link
Contributor

@Glandos out of curiosity, what was your nginx conf ?

@Glandos
Copy link
Member Author

Glandos commented Jul 11, 2018

        location / {
                include uwsgi_params;
                uwsgi_pass unix:/run/uwsgi/ihatemoney.socket;
        }

        location /static {
                gzip_static on;
        }

The uwsgi_params is the one provided in Debian.

And in my uwsgi configuration:

wsgi-file = /var/www/example.com/ihatemoney/ihatemoney/wsgi.py
callable = application
env = IHATEMONEY_SETTINGS_FILE_PATH=/var/www/example.com/ihatemoney/data/ihatemoney.cfg
venv = /var/www/example.com/ihatemoney/venv-system/

@mgautierfr
Copy link

mgautierfr commented Jul 11, 2018

I've got the same problem simply running python run.py in ihatemoney directory (all dependencies being installed).
http://localhost:5000/ was always redirecting to http://localhost:5000/
Other urls were fine.
So no nginx conf where involved.

This PR fixed the problem.

@almet
Copy link
Member

almet commented Jul 11, 2018

The fix seems okay. Can we add a small test case for it? Thanks!

@Glandos
Copy link
Member Author

Glandos commented Jul 11, 2018

Here you are. The test is failing if strict_slashes is not set. And of course, it succeeds if it is set to False.

@JocelynDelalande
Copy link
Contributor

@Glandos nice !

I took the time to fetch and test.

@Glandos last thing, could you add a meaningful ChangeLog entry and squash your commits ?

Thanks for your care and patience!

PS: thanks for the nginx conf sample to satisfy my curiosity :-).

@almet
Copy link
Member

almet commented Aug 5, 2018

fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants