Infrastructure
  1. Infrastructure
  2. INFRA-5367

Apache mirror.cgi - does not recognize Preferred mirror URL ending with slash

    Details

      Description

      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

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Steven J. Hathaway
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development