httpc: reset headers on redirect
When a request is redirected, old headers are of no use anymore and should be dropped. We can detect a redirect by checking the value of CURLINFO_REDIRECT_COUNT. Note about the test: we change the redirect reply to 'redirecting...', so that its length differs from 'hello world'. Close #6101 NO_DOC=bug fix (cherry picked from commit 1cde49d4)
Showing
- changelogs/unreleased/gh-6101-httpc-reset-headers-on-redirect.md 3 additions, 0 deletions...ogs/unreleased/gh-6101-httpc-reset-headers-on-redirect.md
- src/httpc.c 14 additions, 0 deletionssrc/httpc.c
- src/httpc.h 2 additions, 0 deletionssrc/httpc.h
- test/app-luatest/http_client_test.lua 35 additions, 3 deletionstest/app-luatest/http_client_test.lua
- test/app-luatest/httpd.py 1 addition, 1 deletiontest/app-luatest/httpd.py
Please register or sign in to comment