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

[TT-9231] Modified response body with go plugin responses >= 400 #5141

Closed
PatrickTaibel opened this issue Jun 15, 2023 · 4 comments
Closed

Comments

@PatrickTaibel
Copy link
Contributor

Branch/Environment/Version

  • Branch/Version: 5.0.2, master
  • Environment: On-Prem

Describe the bug
The change of #4922 causes Tyk to always send an error message to the client when an error within a go plugin occurs. In case the error is caused by a sent status code >= 400 by the plugin itself this is not desiderable as it will append the Tyk error message to an already existing response from the plugin.

Reproduction steps

  1. Create a go request plugin which writes a status code >= 400 and a response body.
  2. Observe the actual response

Actual behavior
A Tyk plugin error gets appended to the response body. Example from our application:
{"error":"Internal server error"}{"error": "plugin function sent error response code: 500"}
The first JSON object is from our plugin. The second one is from Tyk and shouldn't be there as the response is not a valid JSON anymore.

Additional context
I will create a PR with a potential fix in a minute.

@andyo-tyk
Copy link
Contributor

Hi @PatrickTaibel ,
Sorry for the slow acknowledgement on this - well spotted (we've also spotted this and it's logged on the backlog to be fixed). Thanks for the PR - I'll get the team to review this.

@andyo-tyk andyo-tyk changed the title Modified response body with go plugin responses >= 400 [TT-9231] Modified response body with go plugin responses >= 400 Jul 10, 2023
@jvisker
Copy link

jvisker commented Aug 7, 2023

I (as a part of BYU) logged this same issue internally as well.

@karthikbhat03
Copy link

Hi @jvisker ,
Any ETA for this release, we are also kind of blocked due to this for our production release as we want to maintain compatibility with our older android and ios released apps.

Thanks.

@andyo-tyk
Copy link
Contributor

Hi @PatrickTaibel @jvisker @karthikbhat03,

I'm pleased to confirm that we've got a fix for this issue - it'll be available in Tyk 5.0.7 / Tyk 5.2.2 releases.

Thanks for supporting Tyk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants