Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response transformer plugin causes all requests to timeout #1283

Closed
chrisst opened this issue Jun 1, 2016 · 5 comments
Closed

Response transformer plugin causes all requests to timeout #1283

chrisst opened this issue Jun 1, 2016 · 5 comments
Assignees
Labels

Comments

@chrisst
Copy link

chrisst commented Jun 1, 2016

When I have a response transformer plugin active on an endpoint it seems to cause the endpoint to stop responding, and all requests through that endpoint time out. When I disable the plugin the request start working again.

This appears to happen with all of the different configurations that I have tried on the response transformer plugin, and also happens when there is a single plugin or multiple plugins enabled on the endpoint.

plugin configuration:

{
  "data": [
    {
      "api_id": "<id_here>",
      "id": "<id_here>",
      "created_at": 1464822763000,
      "enabled": true,
      "name": "response-transformer",
      "config": {
        "remove": {
          "json": {},
          "headers": {}
        },
        "add": {
          "json": {},
          "headers": {}
        },
        "replace": {
          "json": {},
          "headers": {}
        },
        "append": {
          "json": {},
          "headers": {}
        }
      }
    }
  ],
  "total": 1
}
@subnetmarco
Copy link
Member

subnetmarco commented Jun 1, 2016

Is the response returned by the API a streaming response?

@chrisst
Copy link
Author

chrisst commented Jun 1, 2016

Nope, just a basic call through to httpbin

{
  "upstream_url": "http://httpbin.org/get",
  "strip_request_path": true,
  "request_path": "/test",
  "id": "2f1c6f37-2a28-48ad-bb18-3187cc8bf4d2",
  "created_at": 1464822704000,
  "preserve_host": false,
  "name": "test"
}

@subnetmarco
Copy link
Member

Can you try to replicate this with the new 0.8.3 release?

@Tieske
Copy link
Member

Tieske commented Jun 2, 2016

Has been fixed by #1263 @ThorArakis please confirm.

As there is no body transform, the content-length header would be left unchanged by the plugin. Yet, the body would be parsed, and then re-jsonified. Causing a different length because of whitespace differences between the original and the re-jsonified body.

@Tieske Tieske added the task/bug label Jun 2, 2016
@Tieske Tieske self-assigned this Jun 2, 2016
@chrisst
Copy link
Author

chrisst commented Jun 2, 2016

I just pulled the latest from master and can confirm that the response transformer no longer kills the request! Thanks!

@chrisst chrisst closed this as completed Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants