1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add API endpoint for OPML export

This commit is contained in:
Rogier Lommers 2018-01-12 22:42:36 +01:00 committed by fguillot
parent 9652dfa1fe
commit 4aec2453f4
3 changed files with 21 additions and 0 deletions

View file

@ -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))
}