Wicket
  1. Wicket
  2. WICKET-1426

URL creation in wicket-ajax.js -> Wicket.Ajax.Call.doGet produces broken URLs for Gecko

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.2
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Firefox 2

      Description

      With r628015 (Wicket 1.3.2) creation of full URL for Gecko browsers creates broken URLs when there is a slash ('/') in the http parameter values.

      For example when a page with this URL is loaded:
      http://localhost/app?key=value/
      wicketAjaxGet will issue a query with this content:
      http://localhost/app?key=value/../?wicket:interface=:....

      By RFC2396 the query part of URL could be:

      query = *uric
      uric = reserved | unreserved | escaped
      reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
      "$" | ","
      unreserved = alphanum | mark

      So '/' is allowed.

      Here is a quick patch:

      — wicket-ajax.js (revision 637425)
      +++ wicket-ajax.js (working copy)
      @@ -823,6 +823,10 @@
      if (t != null) {
      if (Wicket.Browser.isGecko()) {
      var href = document.location.href;
      + var lastIndexOfQuestionMark = href.lastIndexOf('?');
      + if (lastIndexOfQuestionMark > -1)

      { + href = href.substring(0, lastIndexOfQuestionMark); + }

      var lastIndexOf = href.lastIndexOf('/');
      if (lastIndexOf > 0)
      {

        Activity

        Martin Grigorov created issue -
        Igor Vaynberg made changes -
        Field Original Value New Value
        Assignee Matej Knopp [ knopp ]
        Matej Knopp made changes -
        Resolution Cannot Reproduce [ 5 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Matej Knopp
            Reporter:
            Martin Grigorov
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development