if ((follow_xff) &&
GetHash(HTTPHeaders, HKEY("X-FORWARDED-HOST"), &vLine) &&
(vLine != NULL)) {
- safestrncpy(WCC->http_host, &buf[18], sizeof WCC->http_host);
+ safestrncpy(WCC->http_host,
+ ChrPtr((StrBuf*)vLine),
+ sizeof WCC->http_host);
}
if (IsEmptyStr(WCC->http_host) &&
GetHash(HTTPHeaders, HKEY("HOST"), &vLine) &&
body_start = StrLength(content);
/** Read the entire input data at once. */
- client_read(&WCC->http_sock, content, ReadBuf, ContentLength);
+ client_read(&WCC->http_sock, content, ReadBuf, ContentLength + body_start);
if (!strncasecmp(ChrPtr(ContentType), "application/x-www-form-urlencoded", 33)) {
StrBufCutLeft(content, body_start);