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

Not possible retrieve only header from JavaScript request.head() method

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 7.0.18
    • Server (S)
    • None

      https://www.zabbix.com/documentation/7.4/en/manual/config/items/preprocessing/javascript/javascript_objects#httprequest

      Support to use:

      head(url)

      But in practice, it reports an empty result. This is the contents of "head.js":

      var request = new HttpRequest();
      return request.head("https://www.zabbix.com");

      After testing with:

      zabbix_js -s head.js -p 1

      It reports an empty result. With request.get("https://www.zabbix.com") it works fine.

      The source code responsible for the request seems to be:
      https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/src/libs/zbxembed/httprequest.c?at=release%2F7.0

      Expected is a similar output as with "curl" from the command line:

      curl --head https://www.zabbix.com/

            zabbix.dev Zabbix Development Team
            aigars.kadikis Aigars Kadikis
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: