httpc: add a decoders to a http response
Patch fixes a bug when body in response couldn't be decoded: NO_WRAP ``` tarantool> httpc = require('http.client').new() tarantool> response = httpc:get('https://jsonplaceholder.typicode.com/todos/1' ) tarantool> response:decode() --- - error: 'builtin/http.client.lua:301: attempt to index field ''decoders'' (a nil value)' ... ``` NO_WRAP Now response object contains table with decoders defined by user in his http client instance. We hide this table on response serialization by adding underscore because decoders there is not a part of API. Reported-by:Alexander Turenko <alexander.turenko@tarantool.org> Fixes #8363 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-8363-unable-decode-body.md 3 additions, 0 deletionschangelogs/unreleased/gh-8363-unable-decode-body.md
- src/lua/httpc.lua 18 additions, 1 deletionsrc/lua/httpc.lua
- test/app-luatest/http_client_test.lua 11 additions, 0 deletionstest/app-luatest/http_client_test.lua
- test/app-luatest/http_client_unit_test.lua 4 additions, 3 deletionstest/app-luatest/http_client_unit_test.lua
- test/app-luatest/httpd.py 7 additions, 0 deletionstest/app-luatest/httpd.py
Loading