Fix nextcloud issues

This commit is contained in:
2023-07-02 13:50:07 +02:00
parent cd25120362
commit cb04af739c
6 changed files with 22 additions and 7 deletions

View File

@ -460,3 +460,11 @@ int http_get_compression(const http_req *req, const http_res *res) {
}
return 0;
}
long http_get_keep_alive_timeout(http_hdr *hdr) {
const char *keep_alive = http_get_header_field(hdr, "Keep-Alive");
if (!keep_alive) return -1;
const char *timeout = strstr(keep_alive, "timeout=");
if (!timeout) return -1;
return strtol(timeout + 8, NULL, 10);
}