diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-19 15:53:33 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-19 15:53:33 +0100 |
commit | be33c76aee8486ea28c021aca2f6be4293d2e62e (patch) | |
tree | a53bf9baee4b228efcd6f20b44f4aad44c6b836c /file.c | |
parent | c6c7c4b1ec923f484e25b615d920a40d917d2936 (diff) |
properly terminate headers of http responses without data, add Content-Length: 0
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -222,6 +222,7 @@ uh_path_lookup(struct client *cl, const char *url) url with trailing slash appended */ if (!slash) { uh_http_header(cl, 302, "Found"); + ustream_printf(cl->us, "Content-Length: 0\r\n"); ustream_printf(cl->us, "Location: %s%s%s\r\n\r\n", &path_phys[docroot_len], p.query ? "?" : "", @@ -556,6 +557,8 @@ static void uh_file_data(struct client *cl, struct path_info *pi, int fd) !uh_file_if_range(cl, &pi->stat) || !uh_file_if_unmodified_since(cl, &pi->stat) || !uh_file_if_none_match(cl, &pi->stat)) { + ustream_printf(cl->us, "Content-Length: 0\r\n"); + ustream_printf(cl->us, "\r\n"); uh_request_done(cl); close(fd); return; |