Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-7146

APIcast appends a trailing slash to the Upstream Private Base URL

    XMLWordPrintable

Details

    • False
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • No
    • +
    • Undefined

    Description

      As described in the KCS linked, when the Routing Policy is in the policy chain, a trailing slash is appended to the end of the private base url of the upstream.

      This seems to be happening here

      Can be replicated with a configuration like:

      "policy_chain": [
                  {
                      "name": "routing",
                      "version": "builtin",
                      "enabled": true,
                      "configuration": {
                          "rules": [
                              {
                                  "url": "https://echo-api.3scale.net:443/foo",
                                  "owner_id": 2,
                                  "owner_type": "BackendApi",
                                  "condition": {
                                      "operations": [
                                          {
                                              "match": "path",
                                              "op": "matches",
                                              "value": "^(/backend1/.*|/backend1/?)"
                                          }
                                      ]
                                  },
                                  "replace_path": "{{uri | remove_first: '/backend1'}}"
                              }
                          ]
                      }
                  },
                  {
                      "name": "apicast",
                      "version": "builtin",
                      "configuration": {}
                  }
              ]
      

      Request/Response:

      $ curl "https://test-3scale-apicast-staging.amp210.apps-crc.testing:443/backend1?user_key=abc"
      
      {
        "method": "GET",
        "path": "/foo/",
        "args": "user_key=c8d8833898bc331631fb09e4ec853b72",
        "body": "",
         [...]
      

      i.e. `/foo/` is accessed instead of `/foo`.
      This does not happen if the routing policy is not in the policy chain (i.e. if the backend is configured to the public path: `/`)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhn-support-sillumin Samuele Illuminati (Inactive)
              Petr Hála Petr Hála
              Eloy Coto Eloy Coto (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: