Tapestry 5
  1. Tapestry 5
  2. TAP5-1973

In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

    Details

      Description

      An error in the code means that when secure is true and the port is set to 443, then ":443" is appended:

      int port = secure ? secureHostPort : hostPort;
      String portSuffix = "";

      if (port <= 0)

      { port = request.getServerPort(); int schemeDefaultPort = request.isSecure() ? 443 : 80; portSuffix = port == schemeDefaultPort ? "" : ":" + port; }

      else if (secure && port != 443) portSuffix = ":" + port;
      else if (port != 80) portSuffix = ":" + port;

      String hostname = "".equals(this.hostname) ? request.getServerName() : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : this.hostname;

      return String.format("%s://%s%s", secure ? "https" : "http", hostname, portSuffix);

      secure == true && port != 443 is false, so
      port != 80 is evaluated, it true, so
      ":443" is appended.

        Issue Links

          Activity

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Howard M. Lewis Ship
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development