-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Proxito: look for custom 404 pages in the parent project of subprojects #5557
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
Comments
Is someone working on this issue currently? |
@rshrc I don't think so. It's labeled as Please, feel free to analyze its context and give and propose a detailed solution. It would be good to make the discussion happen and work towards the solution. |
Also, I think there is another discussion that can take place here. There are two possible paths to take here,
|
We shouldn't change This is another place where centralizing our logic around this stuff would be really useful. We do have the |
For the design decision:
|
@ericholscher that makes sense to me. To follow that direction, I propose:
I'm removing
I agree with this, but it's something that we can handle in another issue. |
I don't think this is a problem anymore, currently we are using django's URL resolve + readthedocs.org/readthedocs/proxito/views/serve.py Lines 465 to 472 in cd8f2da
(new proxito implementation doesn't have this problem either) And quick test to confirm https://test.org.stsewd.dev/projects/stsewd-demo/en/fasfd You can see the source code to check that the 404 page served was from the subproject. What we don't do yet is this
|
Should we do this? |
I'm -1, since that would require more calls to storage :) |
Makes sense to me :) |
After implementing #353 we do support custom 404 pages if we find a
404.html
page in the current version (or default version) of the project.Although, if we are accessing a
subproject
this logic does not work and the standard 404 page is served.My guess is that the problem is at
https://github.com/rtfd/readthedocs.org/blob/2e29b61a815994b646dda204b975e1c8d7926b79/readthedocs/core/views/__init__.py#L193
Since that function checks for
request.slug
and if it does exist it just return it, but thatrequest.slug
is always set to the superproject athttps://github.com/rtfd/readthedocs.org/blob/2e29b61a815994b646dda204b975e1c8d7926b79/readthedocs/core/middleware.py#L71
or here if it's a custom domain,
https://github.com/rtfd/readthedocs.org/blob/2e29b61a815994b646dda204b975e1c8d7926b79/readthedocs/core/middleware.py#L85
In the end, the subproject is never considered when looking for a custom 404.
I'm not sure how big will be the impact of setting the subproject's slug to
request.slug
(which seems more accurate to me) in other places of the codebase.The text was updated successfully, but these errors were encountered: