Uploaded image for project: 'Elements Connect'
  1. Elements Connect
  2. CO-3813

Getting "403 Forbidden" when connecting to some URL datasources when the "User-Agent" header is not configured

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.6.3
    • Fix Version/s: 6.9.0
    • Labels:
      None
    • Environment:

      Jira 8.15.0

    • Functional components:
      Datasource - URL

      Description

      How to reproduce

      Current result

      Error message: HTTP 403 - Error! Response from server : 'Forbidden'

      Expected result

      It works.

      Notes

      No error when fetching this url from:

      • Browser
      • Curl
      • Postman

      Workaround

      Root cause

      When Elements Connect makes a HTTP request, it sets some default headers:

      • accept: text/html, image/gif, image/jpeg, ; q=.2, */; q=.2
      • connection: keep-alive
      • host: The host name of the target URL datasource
      • user-agent: Java/x.y.z (where x.y.z is the version of Java used to execute the Jira process)

      Unfortunately, some webserver (like nodejs) blacklist any requests where a "Java/XXX" user-agent header is set.

      Solution

      Override the default header set by Elements Connect from the datasource configuration:

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              christophe.prome@valiantys.com Christophe Promé
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: