From 1cbf93502df4d537f3774347e51554e94a01264e Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 11 Apr 2014 18:08:14 +0000 Subject: [PATCH] Use proper content-type for RSS feed --- rophako/modules/blog.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rophako/modules/blog.py b/rophako/modules/blog.py index d90d5e6..45423b7 100644 --- a/rophako/modules/blog.py +++ b/rophako/modules/blog.py @@ -2,7 +2,7 @@ """Endpoints for the web blog.""" -from flask import Blueprint, g, request, redirect, url_for, session, flash +from flask import Blueprint, g, request, redirect, url_for, session, flash, make_response import re import datetime import calendar @@ -291,7 +291,9 @@ def rss(): ["pubDate", time.strftime(rss_time, time.gmtime(post["time"]))], ]) - return doc.toprettyxml(encoding="utf-8") + resp = make_response(doc.toprettyxml(encoding="utf-8")) + resp.headers["Content-Type"] = "application/rss+xml; charset=utf-8" + return resp def xml_add_text_tags(doc, root_node, tags): @@ -423,4 +425,4 @@ def partial_tags(): g.info["tags"] = result g.info["has_small"] = has_small - return template("blog/categories.inc.html") \ No newline at end of file + return template("blog/categories.inc.html")