瀏覽代碼

Add support for HTTP 1.0

master
JustAnotherArchivist 1 年之前
父節點
當前提交
af25c108ba
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      http-response-bodies.c

+ 2
- 2
http-response-bodies.c 查看文件

@@ -63,7 +63,7 @@ checkstate:
}
// Handle optional URL + Length line
url = NULL;
if (memcmp(bufp, "HTTP/1.1 ", 9) != 0) {
if (memcmp(bufp, "HTTP/1.1 ", 9) != 0 && memcmp(bufp, "HTTP/1.0 ", 9) != 0) {
DEBUG_PRINTF("No HTTP header, looking for URL line\n");
m0 = memmem(bufp, n, "\n", 1);
if (!m0 || m0 == bufp) {
@@ -109,7 +109,7 @@ checkstate:
fprintf(stderr, "Error: too little data before HTTP headers\n");
return 1;
}
if (memcmp(bufp, "HTTP/1.1 ", 9) == 0) {
if (memcmp(bufp, "HTTP/1.1 ", 9) == 0 || memcmp(bufp, "HTTP/1.0 ", 9) == 0) {
// Got some headers; find transfer encoding, content length, and end of headers
eoh = memmem(bufp, n, "\r\n\r\n", 4);
if (!eoh) {


Loading…
取消
儲存