www-infrastructure-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven J. Hathaway (JIRA)" <j...@apache.org>
Subject [jira] [Created] (INFRA-5367) Apache mirror.cgi - does not recognize Preferred mirror URL ending with slash
Date Mon, 08 Oct 2012 23:36:02 GMT
Steven J. Hathaway created INFRA-5367:

             Summary: Apache mirror.cgi - does not recognize Preferred mirror URL ending with
                 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:


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
  # 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"
<!--[end] [end]-->
<!--[if-any ftp] [for ftp]--><option value="[ftp]">[ftp]</option>
<!--[end] [end]-->
<!--[if-any backup] [for backup]--><option value="[backup]">[backup]
<!--[end] [end]--></select> <input value="Change" type="submit">


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

View raw message