You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@infra.apache.org by "#asfinfra IRC Bot (JIRA)" <ji...@apache.org> on 2012/10/09 10:24:02 UTC
[jira] [Commented] (INFRA-5367) Apache mirror.cgi - does not
recognize Preferred mirror URL ending with slash
[ https://issues.apache.org/jira/browse/INFRA-5367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472214#comment-13472214 ]
#asfinfra IRC Bot commented on INFRA-5367:
------------------------------------------
<danielsh> Ideally we'll tolerate mirrors either with or without a trailing slash. Can you perhaps suggest a patch to this effect?
> Apache mirror.cgi - does not recognize Preferred mirror URL ending with slash
> -----------------------------------------------------------------------------
>
> Key: INFRA-5367
> URL: https://issues.apache.org/jira/browse/INFRA-5367
> Project: Infrastructure
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: Dists, Mirrors
> Reporter: Steven J. Hathaway
>
> There is a BUG in the python script for:
> http://www.apache.org/dyn/mirrors/mirrors.cgi
> that prevents web pages (i.e. XERCES mirror downloads) from specifying a specific mirror from a selection of mirrors. This issue is also common to other Apache projects.
> The problem is that the list of mirrors is populated from the database file "mirrors.list" that have the URI's
> appended with a slash. The python script that looks for a Preferred mirror expects the parameter to NOT HAVE an appended slash.
> It looks like the Apache mirror.cgi python script needs to be fixed.
> This code snip shows where the '/' is being mistreated.
> Here is the snip of code from Apache dyn/mirrors/mirrors.cgi that has the issue:
> # Check if the requested Preferred mirror is in the list
> # Note the user-requested mirror doesn't have a trailing-slash
> prefmir = None
> if preferred:
> for mir in mirrors:
> if mir[2][:-1] == preferred:
> prefmir = mir
> break
> # Otherwise pick a preferred mirror from our country
> --
> This snip is from the Xerces page that creates a form to select a preferred mirror. This should allow the user to select a specific mirror for downloads. The resulting GET method invokes the mirror.cgi with a URL that looks like:
> "xerces.apache.org/mirrors.cgi&Preferred="the preferred mirror string/"
> Note that "the preferred mirror string/" is uri-encoded and ends with a slash.
> <p>You are currently using the <strong>[preferred]</strong> mirror.
> If you encounter a problem with this mirror, please select another mirror.
> If all mirrors are failing, there are <em>backup</em> mirrors
> (at the end of the mirrors list) that should be available.</p>
> <a name="SelectMirror"></a>
> <form action="[location]" method="get" id="SelectMirror">Other mirrors:
> <select name="Preferred">
> <!--[if-any http] [for http]--><option selected="selected"
> value="[http]">[http]</option>
> <!--[end] [end]-->
> <!--[if-any ftp] [for ftp]--><option value="[ftp]">[ftp]</option>
> <!--[end] [end]-->
> <!--[if-any backup] [for backup]--><option value="[backup]">[backup]
> (backup)</option>
> <!--[end] [end]--></select> <input value="Change" type="submit">
> </form>
> --
> Sincerely,
> Steven J. Hathaway
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira