Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-26996

HttpRequest.customRequest sending wrong METHOD with IPv6 URL

XMLWordPrintable

    • Support backlog

      Steps to reproduce:

      var request = new HttpRequest();
      var url = "https://[2001:db8:ac:ac::1234]/api/aaaLogin.json";
      var method = "POST";
      var body = JSON.stringify({
        "aaaUser" : {
          "attributes" : {
            "name" : "admin",
            "pwd" : "mysuperduperpassword"
          }
        }
      });
      response = request.customRequest(method.toUpperCase(), url, body);
      
      /**
       * Actual result: 400 Bad Request
       * 
       * from webserver logs i can see that HTTP method was 'Login.json' instead of 'POST'.
       * i.e.  Login.json  /api/aaaLogin.json HTTP/1.1   -> 400 Bad Request
       * 
       * Expected result: 200 OK
       * Good example on webserver logs shows:   POST  /api/aaaLogin.json HTTP/1.1
       */
      

      Result:

      Webserver returns  400 bad request.

      Upon investigation the webserver logs I see that the  METHOD was  'Login.json'  instead of 'POST'

      Expected:

      HTTP method should not be altered when using  literal  IPv6 within brackets in the url

       

       

            zabbix.dev Zabbix Development Team
            lumean Manuel Widmer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: