You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/08/02 01:55:39 UTC

[jira] [Commented] (TAP5-1973) In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

    [ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083213#comment-14083213 ] 

ASF subversion and git services commented on TAP5-1973:
-------------------------------------------------------

Commit 30a66c9526dee3da55a5204e43a169fe4692df79 in tapestry-5's branch refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=30a66c9 ]

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


> In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1973
>                 URL: https://issues.apache.org/jira/browse/TAP5-1973
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3.4, 5.4
>            Reporter: Howard M. Lewis Ship
>            Assignee: Howard M. Lewis Ship
>              Labels: fixed-in-5.4-js-rewrite
>             Fix For: 5.4
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)