Commit Diff


commit - 2be11cdeee0c210d3273b3724e924de0422d9f67
commit + 92c8ec640028151d1e92eaef79c4fcd1365998bc
blob - 89718fdd602637e74ca5a949af1e7cfda57b723d
blob + 87cec74f0c075ba839a114bdb6c50bdca8ae9160
--- gotwebd/got_operations.c
+++ gotwebd/got_operations.c
@@ -1044,7 +1044,7 @@ got_output_file_blob(struct request *c)
 			if (isbinary(buf, len - hdrlen)) {
 				error = gotweb_render_content_type_file(c,
 				    "application/octet-stream",
-				    qs->file);
+				    qs->file, NULL);
 				if (error) {
 					log_warnx("%s: %s", __func__,
 					    error->msg);
blob - 6f5a07850b9e8e153830292e5ce4f4d986782eff
blob + 71c0cc53686a79ce8460d54182ee5f79b42fe117
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
@@ -179,8 +179,9 @@ gotweb_process_request(struct request *c)
 	}
 
 	if (qs->action == RSS) {
-		error = gotweb_render_content_type(c,
-		    "application/rss+xml;charset=utf-8");
+		error = gotweb_render_content_type_file(c,
+		    "application/rss+xml;charset=utf-8",
+		    repo_dir->name, ".rss");
 		if (error) {
 			log_warnx("%s: %s", __func__, error->msg);
 			goto err;
@@ -670,11 +671,11 @@ gotweb_render_content_type(struct request *c, const ui
 
 const struct got_error *
 gotweb_render_content_type_file(struct request *c, const char *type,
-    const char *file)
+    const char *file, const char *suffix)
 {
 	fcgi_printf(c, "Content-type: %s\r\n"
-	    "Content-disposition: attachment; filename=%s\r\n\r\n",
-	    type, file);
+	    "Content-disposition: attachment; filename=%s%s\r\n\r\n",
+	    type, file, suffix ? suffix : "");
 	return NULL;
 }
 
blob - 8a9deffd75b83126733cb4d76bb9170bc7604995
blob + 2e636f2ae10ecc8792581ba3ec50726f33ca127f
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
@@ -437,7 +437,7 @@ const struct got_error *gotweb_render_content_type(str
     const uint8_t *);
 const struct got_error
     *gotweb_render_content_type_file(struct request *, const char *,
-    const char *);
+    const char *, const char *);
 void gotweb_get_navs(struct request *, struct gotweb_url *, int *,
     struct gotweb_url *, int *);
 const struct got_error *gotweb_get_time_str(char **, time_t, int);