You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tor-Einar Jarnbjo (JIRA)" <ji...@apache.org> on 2015/06/30 11:33:04 UTC

[jira] [Created] (WICKET-5938) Url.parse does not support URL fragments

Tor-Einar Jarnbjo created WICKET-5938:
-----------------------------------------

             Summary: Url.parse does not support URL fragments
                 Key: WICKET-5938
                 URL: https://issues.apache.org/jira/browse/WICKET-5938
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.18.0
            Reporter: Tor-Einar Jarnbjo


The org.apache.wicket.request.Url class does not seem to have support for URL fragments (the part of the URL following the # character and e.g. used for intra-page anchors in HTTP URLs). 

Url.parse will in all cases (as far as I can tell) encode the hash character with "%23", causing it to lose it's property as a fragment separator. If e.g. the URL http://server/page.html?arg=value#anchor is run through the Url class, it comes out as http://server/page.html?arg=value%23anchor. This factually changes the "arg" query parameters value from "value" to "value#anchor" and the fragment is lost.

The issue occurs e.g. when throwing a RedirectToUrlException with status SC_MOVED_TEMPORARILY, since the provided URL is then parsed and treated with the org.apache.wicket.request.Url class. For some non-obvious reason, redirecting the response with SC_MOVED_PERMANENTLY or SC_SEE_OTHER sets the Location parameter in the HTTP response directly, without further processing of the redirecting URL or its components.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)