httpc: allow to don't auto-follow redirects
While we are here also added forgotten option descriptions to httpc.lua. @TarantoolBot document Title: httpc: new 'follow_location' option When the option is set to `true` (which is default) and a response has 3xx code the http client will automatically issue another request to a location that a server sends in 'Location' header. If the new response is 3xx again, the http.client will issue a next request and so on in a loop until a non-3xx response will be received. This last response will be returned as a result. Setting this option to `false` allows to disable this behaviour. In this case the http client will return a 3xx response itself. See https://curl.haxx.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html
Showing
- src/httpc.c 7 additions, 0 deletionssrc/httpc.c
- src/httpc.h 10 additions, 0 deletionssrc/httpc.h
- src/lua/httpc.c 5 additions, 0 deletionssrc/lua/httpc.c
- src/lua/httpc.lua 13 additions, 3 deletionssrc/lua/httpc.lua
- test/app-tap/http_client.test.lua 25 additions, 1 deletiontest/app-tap/http_client.test.lua
- test/app-tap/httpd.py 8 additions, 0 deletionstest/app-tap/httpd.py
Loading
Please register or sign in to comment