diff options
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)) +} |