return;
}
- // Remember, ctdl_printf() appends \n on its own, so we only need \r here.
+ // Remember, ctdl_printf() appends \n on its own, so when adding a CRLF newline, only use \r
+ // Or for a blank line, use ctdl_write() with \r\n
+
content_type = header_val(h, "Content-type");
ctdl_printf(c, "Content-type: %s\r", (content_type ? content_type : "application/octet-stream"));
- ctdl_printf(c, "\r");
+ ctdl_write(c, HKEY("\r\n"));
ctdl_write(c, h->request_body, h->request_body_length);
if (h->request_body[h->request_body_length] != '\n') {
- ctdl_printf(c, "\r");
+ ctdl_write(c, HKEY("\r\n"));
}
ctdl_printf(c, "000");