ICEpush
  1. ICEpush
  2. PUSH-48

appendToURI() does not check for existing parameter in uri

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Alpha3
    • Component/s: Java Client
    • Labels:
      None
    • Environment:
      n/a

      Description

      in http.js:

      appendToURI(parameters,uri) doesn't check if the uri already has parameters and will create a uri that includes multiple '?' characters, breaking the parameters

        Issue Links

          Activity

          Hide
          Mircea Toma added a comment -

          Check if the provided URI already includes a query before constructing the complete query.

          Show
          Mircea Toma added a comment - Check if the provided URI already includes a query before constructing the complete query.
          Hide
          Philip Breau added a comment -

          recommended patch

          Index: /home/philip/workspace/ICEpush/core/src/main/javascript/lib/http.js
          ===================================================================
          — /home/philip/workspace/ICEpush/core/src/main/javascript/lib/http.js (revision 20781)
          +++ /home/philip/workspace/ICEpush/core/src/main/javascript/lib/http.js (working copy)
          @@ -73,7 +73,7 @@

          method(appendToURI, function(self, uri) {
          if (not(isEmpty(parameters)))

          { - return uri + '?' + asURIEncodedString(self); + return uri + ( uri.indexOf('?') == -1 ? '?' : '&' ) + asURIEncodedString(self); }

          else

          { return uri; }
          Show
          Philip Breau added a comment - recommended patch Index: /home/philip/workspace/ICEpush/core/src/main/javascript/lib/http.js =================================================================== — /home/philip/workspace/ICEpush/core/src/main/javascript/lib/http.js (revision 20781) +++ /home/philip/workspace/ICEpush/core/src/main/javascript/lib/http.js (working copy) @@ -73,7 +73,7 @@ method(appendToURI, function(self, uri) { if (not(isEmpty(parameters))) { - return uri + '?' + asURIEncodedString(self); + return uri + ( uri.indexOf('?') == -1 ? '?' : '&' ) + asURIEncodedString(self); } else { return uri; }

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Philip Breau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: