Hi,
So I’m still testing around to try and find what would be the best fit for our application since we need a potent middleware. So far I think gRPC will be the way to go, no complicated installation in Tyk and it leverages the full potential of the language we will choose.
I just have a quick question about ReturnOverrides.
I created this small middleware :
`const postMiddleware = (obj, callback) => {
var req = obj.request
// req is the coprocess.MiniRequestObject, we inject a header using the "set_headers" field:
req.set_headers = {
'mycustomheader': 'post'
}
req.return_overrides = {
response_code: 200,
response_error: JSON.stringify({"test":"value"}),
headers: {
'myresponseheader': 'value'
}
}
// Use this callback to finish the operation, sending back the modified object:
callback(null, obj)
}`
Works well but I noticed the calls to the related API are no longer shown in the Log browser of my Dashboard. I believe it is because using ReturnOverrides stops the request flow. But is there a way to still have the data in the logs ? If not yet possible, that would be nice to have
Last thing, I think there might be an error in the documentation https://tyk.io/docs/customise-tyk/plugins/rich-plugins/rich-plugins-data-structures/#returnoverrides-coprocess-return-overrides-proto
It says “The ReturnOverrides object, when returned as part of a Coprocess.Object” but the ReturnOverrides is part of the MiniRequestObject. Maybe it’s written that way because Coprocess.MiniRequestObject is part of Coprocess.Object but I found it confusing.
Anyway, thanks !
Robert