viewauth Redirect May Add Superfluous Slash
For read-authenticated topics, a redirect from
With the 4.1.2 distribution, when one
then the redirect adds a superfluous
. I.e., the URL has two slashes after redirection.
While this works, it is a nuisance as it causes inter-topic links to reload the page, since the base href in the page is without the double slash and thus different to the page's URL.
Setup a TWiki that doesn't use the
prefix to show URLs.
Use ApacheLogin authentication.
Set ALLOWTOPICVIEW for one topic (say, Test.TestPage).
Access that page with a user that is listed in the topic ACL.
That user must not have logged in before in that session (otherwise the CGI session may supply the user credentials).
The user uses the URL
After authentication, the URL gets rewritten to
. (Please note the double slash.)
Root Cause Analysis and Patch
The root cause is in Client::ApacheLogin on line 94, where PATH_INFO is appended with an intermitting slash. But PATH_INFO starts already with a slash, that additional slash is not needed.
That else-clause is only used if
is not in the request URI, i.e., when one uses shortened URLs. Therefore the bug is not visible in standard TWiki setups.
I attach a patch to the 4.1.2 distribution that fixes the problem.
- 27 Apr 2007
Fixed in MAIN