Uploaded image for project: 'SwitchYard'
  1. SwitchYard
  2. SWITCHYARD-2034

StandaloneEndpointPublisher fails to parse query parameters

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0, 1.1
    • Fix Version/s: 2.0
    • Component/s: component-http
    • Labels:
      None

      Description

      org.switchyard.component.http.endpoint.StandaloneEndpointPublisher that is used in testing has a bug in HTTP request query parameter handling that breaks on parameters with no value (...?param= or .../param1=&param2=val2).

      The actual offending code (StandaloneEndpointPublisher.java:184):

              // Http Query params...
              if (requestInfo.getQueryString() != null) {
                  StringTokenizer params = new StringTokenizer(requestInfo.getQueryString(), "&");
                  while (params.hasMoreTokens()) {
                      String param = params.nextToken();
                      String[] nameValue = param.split("=");
                      requestInfo.addQueryParam(nameValue[0], nameValue[1]);
                  }
              }
      

      In case of param containing "param=" with no value, nameValue will be [ "param" ], an array of size 1, not 2. Exception.

      From my experience, this actually hangs unit tests that hit this bug.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  arteme Artem Egorkine
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: