You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Maarten Billemont (JIRA)" <ji...@apache.org> on 2008/10/08 14:01:44 UTC

[jira] Created: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

MockHttpServletRequest does not support absolute redirection URLs.
------------------------------------------------------------------

                 Key: WICKET-1864
                 URL: https://issues.apache.org/jira/browse/WICKET-1864
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-M3
            Reporter: Maarten Billemont


Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.

The following code needs to change (line 1277):
		// We need to absolutize the redirect URL as we are not as smart as a web-browser
		// (WICKET-702)
		url = getContextPath() + getServletPath() + "/" + redirect;
into, for example:
		// We need to absolutize the redirect URL as we are not as smart as a web-browser
		// (WICKET-702)
		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;

After a few redirects I end up at:
/BankApplication/BankApplication//BankApplication
Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1864:
-------------------------------------

    Assignee: Igor Vaynberg

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.6, 1.4-RC2
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1864:
-------------------------------------

    Assignee:     (was: Igor Vaynberg)

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Martin Makundi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Makundi updated WICKET-1864:
-----------------------------------

    Attachment: Wicket-Quickstart.zip

1.4-rc2 breaks some tests related to redirects. The attached test passed with 1.4-rc1 but not with 1.4-rc2? Is it a user-bug or new bug?


> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1864.
-----------------------------------

      Assignee: Igor Vaynberg
    Resolution: Cannot Reproduce

works with 1.4.10+, mustve been fixed along the way

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>            Assignee: Igor Vaynberg
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1864.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-RC2
                   1.3.6

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.6, 1.4-RC2
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-1864:
----------------------------------

    Fix Version/s:     (was: 1.3.6)
                   1.3.7

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>             Fix For: 1.3.7, 1.4-RC2
>
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-1864:
----------------------------------

    Fix Version/s:     (was: 1.3.8)
                       (was: 1.4-RC2)

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-1864:
----------------------------------

    Fix Version/s:     (was: 1.3.7)
                   1.3.8

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>             Fix For: 1.3.8, 1.4-RC2
>
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Maarten Billemont (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637905#action_12637905 ] 

Maarten Billemont commented on WICKET-1864:
-------------------------------------------

Make that code suggestion:


		url = getContextPath() +
			(redirect.charAt(0) == '/' ? redirect : (getServletPath() + "/" + redirect));

> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (WICKET-1864) MockHttpServletRequest does not support absolute redirection URLs.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reopened WICKET-1864:
-----------------------------------


> MockHttpServletRequest does not support absolute redirection URLs.
> ------------------------------------------------------------------
>
>                 Key: WICKET-1864
>                 URL: https://issues.apache.org/jira/browse/WICKET-1864
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Maarten Billemont
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: Wicket-Quickstart.zip
>
>
> Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.
> The following code needs to change (line 1277):
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = getContextPath() + getServletPath() + "/" + redirect;
> into, for example:
> 		// We need to absolutize the redirect URL as we are not as smart as a web-browser
> 		// (WICKET-702)
> 		url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;
> After a few redirects I end up at:
> /BankApplication/BankApplication//BankApplication
> Which is not where I want to be.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.