Browse Source

Add support for HTTP 1.0

master
JustAnotherArchivist 1 year ago
parent
commit
af25c108ba
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      http-response-bodies.c

+ 2
- 2
http-response-bodies.c View File

@@ -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…
Cancel
Save