diff options
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -34,7 +34,7 @@ #include "http.h" #include "mime.h" -#include "str.h" +#include "url.h" bool http_open_file(struct kreq * r, enum khttp code, const struct file * f) @@ -49,13 +49,9 @@ http_open_file(struct kreq * r, enum khttp code, const struct file * f) return false; /* file name needs to be url encoded for special chars */ - filename = khttp_urlencode(filename); - if (filename == NULL) + if ((filename = url_encode(filename)) == NULL) return false; - /* but for some reason, spaces should remain spaces... */ - str_replace(filename, '+', ' '); - khttp_head(r, kresps[KRESP_STATUS], "%s", khttps[code]); khttp_head(r, kresps[KRESP_CONTENT_DISPOSITION], "attachment;filename=\"%s\"", filename); |