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

Incorrect processing of headers in JS based templates, for example OpenStack by HTTP

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 7.0.18, 7.4.2, 8.0.0alpha1 (master)
    • Templates (T)
    • Support backlog

      Steps to reproduce:

      1. Configure monitoring of the openstack with OpenStack by HTTP
      2. get not working item Get access token and service catalog, since it returns x-subject-token

      Modify:

      try {
       token = headers["X-Subject-Token"][0];

      with this one:

      try {
       token = headers["x-subject-token"][0];

      And it starts working.

      Expected:
      According to the HTTP specification (RFC 7230), header field names are case-insensitive.
      Issue itself: parseHttpData function on this line:

      token = headers["X-Subject-Token"][0];
      

      Something like this:

          for (const key in headers) {
              if (key.toLowerCase() === 'x-subject-token') {
                  if (Array.isArray(headers[key]) && headers[key].length > 0) {
                      token = headers[key][0];
                  }
                  break;
              }
          }
      

            zit Zabbix Integration Team
            edgar.akhmetshin Edgar Akhmetshin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: