Skip to content
Snippets Groups Projects
Commit 0985260e authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix chunked transfer encoding of web lists

It's Transfer-Encoding:, not Content-Transfer-Encoding:, and each
chunk has a \r\n appended to it.
parent 84c4814a
No related branches found
No related tags found
No related merge requests found
Pipeline #8193 passed
......@@ -698,8 +698,8 @@ parse_headers(struct http_session *sess)
assert_pthread_mutex_unlock(&sess->req->mtx);
}
}
else if(strnicmp(line, "content-transfer-encoding:", 26) == 0) {
const char *val = skipws(&line[26]);
else if(strnicmp(line, "transfer-encoding:", 18) == 0) {
const char *val = skipws(&line[18]);
const char *sep;
const char *end = find_end(val, &sep);
if (sep != NULL) {
......@@ -949,6 +949,13 @@ read_chunked(struct http_session *sess, FILE *out)
set_msg(sess->req, "Short fwrite()");
goto error_return;
}
line = recv_line(sess, 5000, NULL);
if (line == NULL)
goto error_return;
if (line[0] != '\r' || line[1]) {
set_msg(sess->req, "Bad chunk");
goto error_return;
}
}
free(buf);
free(line);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment