Merge pull request #348 from mathewmarcus/fix_issue_347

set cookie for http-form-post redirects
This commit is contained in:
van Hauser 2018-09-20 07:28:35 +02:00 committed by GitHub
commit edfaeed0a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -997,6 +997,15 @@ int32_t start_http_form(int32_t s, char *ip, int32_t port, unsigned char options
if (header_exists(&ptr_head, "Content-Length", HEADER_TYPE_DEFAULT))
hdrrepv(&ptr_head, "Content-Length", "0");
// re-use the above code to set cookies
if (cookie_header != NULL)
free(cookie_header);
cookie_header = stringify_cookies(ptr_cookie);
if (!header_exists(&ptr_head, "Cookie", HEADER_TYPE_DEFAULT))
add_header(&ptr_head, "Cookie", cookie_header, HEADER_TYPE_DEFAULT);
else
hdrrepv(&ptr_head, "Cookie", cookie_header);
//re-use the code above to check for proxy use
if (use_proxy == 1 && proxy_authentication[selected_proxy] != NULL) {
// proxy with authentication