-
I hope to use kong.service.response.get_raw_body() to get the response body in the log phase.
|
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
@eddie04, what version of Kong are you using? I am assuming |
Beta Was this translation helpful? Give feedback.
-
@eddie04 are you sure your plugin executed that |
Beta Was this translation helpful? Give feedback.
-
@eddie04, can you give us any step by step intsructions that how do you get that error? I wrote this plugin, and it seemed to work alright (do you use custom nginx templates or anything like that?):
|
Beta Was this translation helpful? Give feedback.
-
Yes, the version of Kong is 2.4.0 (OSS), and i used follow codes:
Then i got an error above, actually i used this template: https://github.com/Kong/kong-plugin. |
Beta Was this translation helpful? Give feedback.
-
@eddie04, how did you install Kong? What is the listing of |
Beta Was this translation helpful? Give feedback.
-
@eddie04, also did you know about the limitation that it can be enabled with http 1.1 only, e.g. clients making requests with http 2 will fail? It is an unfortunate limitation with OpenResty, perhaps we should not error on it. |
Beta Was this translation helpful? Give feedback.
-
I reinstalled my custom plugin,it's ok now,there is no problem.
BTW I installed Kong in Docker container, and http version is 1.1.
Thanks a lot, @bungle ! |
Beta Was this translation helpful? Give feedback.
-
The error happened again when rewrite response with 403 status code in access phase.
|
Beta Was this translation helpful? Give feedback.
-
@eddie04, Can you share the code for the plugin, with the change you mentioned? The code as you shared above works fine on my end. |
Beta Was this translation helpful? Give feedback.
I reinstalled my custom plugin,it's ok now,there is no problem.
BTW I installed Kong in Docker container, and http version is 1.1.
request: "POST /api/whitelist/query HTTP/1.1"
Thanks a lot, @bungle !