commit - 77d755e8ee27002658ec8f9ed0a282ac89d2906f
commit + d7034a4ea257e654c3ac01eae64452461d31d233
blob - 40e8ef26d1b28b601ac2a1af3b4f766a63e48ece
blob + adaba67ceee3e64ece4fc51654ac750358bfc1b2
--- gotwebd/got_operations.c
+++ gotwebd/got_operations.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 - 6017208e29d944a6b739e580b432aaf6eb981794
blob + efbd65db33afe8b913df52cf9c6ded70308705b8
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.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;
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 - fe2a573ae72fdc13b28304d46671fcdba77efd64
blob + 3c805ab5bb454c73db3f42dc2068c27fe2897265
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
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);