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

Please flip the status codes in the first exaple in HTTP Status Code Overwrite policy example

XMLWordPrintable

    • API CCS Sprint 44 (3Scale) 2

      4.1.14. HTTP Status Code Overwrite
      The section explains that

      For example, you could use the HTTP Status Code Overwrite policy to change upstream 201, "Created", response codes, to 200, "OK", response codes.

      Another example of a response code that you might want to change is the response when a content limit is exceeded. The upstream might return 413, payload too large, when a response code of 414, request-URI too long, would be more helpful.

      and the example json is:

      {
        "name": "statuscode_overwrite",
        "version": "builtin",
        "configuration": {
          "http_statuses": [
            {
              "upstream": 200,
              "apicast": 201
            },
            {
              "upstream": 413,
              "apicast": 414
            }
          ]
        }
      }
      

      The first example is confusing because the status code in the json is reversed from the above explanation.
      So please flip the status codes like this:

      {
        "name": "statuscode_overwrite",
        "version": "builtin",
        "configuration": {
          "http_statuses": [
            {
              "upstream": 201,
              "apicast": 200
            },
            {
              "upstream": 413,
              "apicast": 414
            }
          ]
        }
      }
      

              Unassigned Unassigned
              rhn-support-tkonishi Takayuki Konishi
              Darren Fennessy Darren Fennessy
              Dominik Hlavac Duran Dominik Hlavac Duran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: