summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'http.c')
-rw-r--r--http.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/http.c b/http.c
index 5bad1d8..4dbeff2 100644
--- a/http.c
+++ b/http.c
@@ -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);