Open TvoroG opened 4 years ago
Please, show your foo_method
code.
It simply returns a string
function foo_method()
return 'callback({"foo": "bar"})'
end
And what do you expect?
I'm expecting callback({\"foo\": \"bar\"})
but it returns "callback({\"foo\": \"bar\"})"
.
Try something like this: https://github.com/tarantool/nginx_upstream_module/tree/82355b8a1276ad584308f3ee4cc6e6129ecb302f#http-headers-and-status
Thanks, but i was hoping to do it without lua on nginx.
I agree that it is not convenient to add extra logic on nginx side just to implement an API you need. AFAIU the module was initially made with RPC in a mind, that is why we need to preprocess-postprocess a request and a response to implement, say, restful API. However it would be good to change it in the future.
Hope we should not close the issue, but rather add an option that will do something like the Lua code that I linked above.
Thanks a lot for the module!
I want to wrap json object into callback:
I don't know how to do that. I've tried to return result as simple string from tarantool with following nginx config:
But module returns it wrapped into double quotes