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

Plugins | Response transformer broken on Kong 2.8.1.4 #9461

Closed
1 task done
PalAditya opened this issue Sep 22, 2022 · 4 comments · Fixed by #9463
Closed
1 task done

Plugins | Response transformer broken on Kong 2.8.1.4 #9461

PalAditya opened this issue Sep 22, 2022 · 4 comments · Fixed by #9463

Comments

@PalAditya
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

2.8.1.4

Current Behavior

The response transformer plugin breaks on Kong 2.8.1.4 if there's a string response.

Sample:

- name: response-transformer
  config:
    remove:
       json:
          - "xyz"

Same issue does not occur with response-transformer-advanced

Expected Behavior

The plugin shouldn't crash kong, as the response is plain string and not json.

Steps To Reproduce

- Use Kong 2.8.1.4 in DBLess Mode
- Create any route which points to an upstream that returns a plain string (e.g: "Hello, World")
- Apply response-transformer on the plugin with above config
- Kong will crash.

Anything else?

OS: Rhel8

@VicYP
Copy link

VicYP commented Sep 23, 2022

@PalAditya Thank you for your investigation. We will give it a try and this one needs to be fixed.

@samugi
Copy link
Member

samugi commented Sep 30, 2022

hello @PalAditya, I think I was able to replicate this but there are a couple of details I'd like to clarify:

  • I could only replicate this by having an upstream endpoint return an invalid response body: the upstream API I used returned Content-Type: application/json; while the body was actually text. I could not replicate this with an upstream API that would return Content-Type: text/plain; correctly
  • Kong is not crashing, rather when this happens the connection with the client is closed without a response, no worker is restarted and other requests to valid endpoints keep working

Could you confirm the issue I reproduced reflects your findings?

@PalAditya
Copy link
Author

Hi @samugi , that's right
However, I'm also observing the same behavior if no content-type is set at all.

@samugi
Copy link
Member

samugi commented Nov 7, 2022

resolved by #9463

@samugi samugi closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants