You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2012/07/11 02:58:34 UTC
[jira] [Created] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Howard M. Lewis Ship created TAP5-1973:
------------------------------------------
Summary: :443 added to URLs when using the Link.toAbsoluteURI(true)
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
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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAP5-1973:
------------------------------------------
Assignee: Howard M. Lewis Ship
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship updated TAP5-1973:
---------------------------------------
Labels: fixed-in-5.4-js-rewrite (was: )
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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.3.5
>
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship resolved TAP5-1973.
----------------------------------------
Resolution: Fixed
Fix Version/s: 5.3.5
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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.3.5
>
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship resolved TAP5-1973.
----------------------------------------
Resolution: Fixed
Fix Version/s: 5.3.5
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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.3.5
>
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAP5-1973:
------------------------------------------
Assignee: Howard M. Lewis Ship
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Lenny Primak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481147#comment-13481147 ]
Lenny Primak commented on TAP5-1973:
------------------------------------
I run my production Tapestry apps behind Apache and AJP/JK2 protocol.
In this setup, serverPort is always 8009, and thus always fails the expectedPort test.
This means the new way of appending :443. :80 ports to URLs is broken in my setup.
Since https:// always defaults to :443 and http:// to 80, why is there any appending going on at all?
This should be removed, or at least make it removed by default, and optionally turned on.
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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.3.5
>
>
> 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 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
[jira] [Updated] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship updated TAP5-1973:
---------------------------------------
Labels: fixed-in-5.4-js-rewrite (was: )
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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.3.5
>
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1973) :443 added to URLs when using the
Link.toAbsoluteURI(true)
Posted by "Lenny Primak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481147#comment-13481147 ]
Lenny Primak commented on TAP5-1973:
------------------------------------
I run my production Tapestry apps behind Apache and AJP/JK2 protocol.
In this setup, serverPort is always 8009, and thus always fails the expectedPort test.
This means the new way of appending :443. :80 ports to URLs is broken in my setup.
Since https:// always defaults to :443 and http:// to 80, why is there any appending going on at all?
This should be removed, or at least make it removed by default, and optionally turned on.
> :443 added to URLs when using the Link.toAbsoluteURI(true)
> ----------------------------------------------------------
>
> 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.3.5
>
>
> 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 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