-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Cannot redirect from old version to new version if old version is marked inactive #4598
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
I think the problem is that the docs of an inactive version (the version was already built) aren't removed. In order to a redirect to work, it should be 404, so I'm not sure why the redirect now works (maybe that page doesn't exist?). Also, I believe that there is a task that clean docs from inactive versions, so maybe you only need to wait a little (I haven't look at the code yet, I'll do it by monday or so) |
@stsewd The versions marked inactive had been marked inactive for months. I recently re-marked them active so the redirects would work. I even tried clicking the "clean" button to no avail. |
I got confused at first read. I understand what's happening now and I think there is a bug in our redirection system. As @stsewd mentioned, the redirects are only considered when a 404 is found (there is an issue opened that will change this when implemented #4550).
Even the version of the redirect is That said, redirects should have nothing to do with versions being active or not. That's a bug to me and will take a look at the source code to check why that is happening. The correct setup for your use case should be as what you expect: versions disabled and redirect working without any kind of permission issue. |
This logic is not accurate to me:
I think in the except block, we should check for permissions/version active and decide if we need to return 401 or 404 instead. I will propose a PR soon with these changes. |
Details
Expected Result
Pursuant to #2444 and #4501, I should be able to add a redirect from a now-obsolete version of our documentation (2.1.1) to our current stable version (stable) by adding an Exact redirect:
This should redirect a page such as http://docs.couchdb.org/en/2.1.1/intro/overview.html to http://docs.couchdb.org/en/stable/intro/overview.html .
Actual Result
Accessing http://docs.couchdb.org/en/2.1.1/intro/overview.html results in a Permission Denied error unless that actual version (2.1.1) is marked as an Active Version. Setting the version to be redirected as Inactive makes redirection impossible.
Setting these invalid versions to Active makes them appear in the valid version list, but clicking on them results in them being redirected to somewhere else (in our case, the
stable
tag) which is very confusing for end users.@humitos I believe that redirection checks should occur before checking whether a version is marked as inactive, yes? This way, redirects for obsolete versions would not require those versions to continue to be marked as Active.
The text was updated successfully, but these errors were encountered: