diff options
author | Rogier Lommers <rogier@lommers.org> | 2018-01-12 22:42:36 +0100 |
---|---|---|
committer | fguillot <fred@kanboard.net> | 2018-01-12 13:42:36 -0800 |
commit | 4aec2453f442277c858bab99ae4d0a6cba857a10 (patch) | |
tree | 04895640d061a3f4c728748467d70f4c6cdc4cc4 /http | |
parent | 9652dfa1feccd15bbb56d61281f148f71afcb800 (diff) |
Add API endpoint for OPML export
Diffstat (limited to 'http')
-rw-r--r-- | http/handler/xml_response.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/http/handler/xml_response.go b/http/handler/xml_response.go index b5a24ca..5b647a1 100644 --- a/http/handler/xml_response.go +++ b/http/handler/xml_response.go @@ -21,3 +21,9 @@ func (x *XMLResponse) Download(filename, data string) { x.writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s", filename)) x.writer.Write([]byte(data)) } + +// Serve forces the XML to be sent to browser. +func (x *XMLResponse) Serve(data string) { + x.writer.Header().Set("Content-Type", "text/xml") + x.writer.Write([]byte(data)) +} |