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

Fix URLs like /projects/subproject from 404ing when they don't end with a slash #6888

Merged
merged 8 commits into from Apr 14, 2020

Conversation

ericholscher
Copy link
Member

@ericholscher ericholscher commented Apr 10, 2020

This was hit by users.
You can test it here: https://docs.celeryproject.org/projects/kombu

@ericholscher ericholscher requested a review from davidfischer Apr 10, 2020
@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Apr 10, 2020

Looks good locally:

-> curl -IL http://test-builds.community.dev.readthedocs.io/projects/subproject
HTTP/1.1 302 Found
Server: nginx/1.17.5
Date: Fri, 10 Apr 2020 21:09:30 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 0
Connection: keep-alive
Location: http://test-builds.community.dev.readthedocs.io/projects/subproject/en/latest/
X-RTD-System-Redirect: True
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Vary: Accept-Language, Cookie
Content-Language: en
X-Served: Django-Proxito

Copy link
Contributor

@davidfischer davidfischer left a comment

Looks good.

Edit: once the CI is fixed up.

@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Apr 10, 2020

We also have an issue with single-single subprojects, eg http://test-builds.community.dev.readthedocs.io/projects/single-version
where they 404 currently, and with that change, it serves the files but all media breaks (because it needs the /)

@ericholscher ericholscher requested a review from humitos Apr 13, 2020
Copy link
Member

@humitos humitos left a comment

Looks good to me. I want to understand one the cases added, only.

Test are not passing for some reason as well.

readthedocs/proxito/views/serve.py Show resolved Hide resolved
@humitos
Copy link
Member

@humitos humitos commented Apr 13, 2020

Test are not passing for some reason as well.

Ah, we need to update the matching of the URLs because there is a new attribute now.

@humitos
Copy link
Member

@humitos humitos commented Apr 14, 2020

Weird... our own build on RTD failed because of timeout. Is our project already that big?

@ericholscher ericholscher merged commit 0dd5b61 into master Apr 14, 2020
2 checks passed
@ericholscher ericholscher deleted the fix-subproject-no-slash branch Apr 14, 2020
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

3 participants