summaryrefslogtreecommitdiffstats
path: root/modules/middleware/render.go
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-23 01:44:02 +0800
committerslene <vslene@gmail.com>2014-03-23 01:44:02 +0800
commit076fc98d981aea3533eea363ca1c7e43f77b9802 (patch)
tree596d754de0d53a7e0794dcd61122ddb85298a0e1 /modules/middleware/render.go
parent01e781dedb3c6d48349516de0eee5cea41c077e1 (diff)
downloadgitea-076fc98d981aea3533eea363ca1c7e43f77b9802.tar.gz
gitea-076fc98d981aea3533eea363ca1c7e43f77b9802.zip
add csrf check
Diffstat (limited to 'modules/middleware/render.go')
-rw-r--r--modules/middleware/render.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/middleware/render.go b/modules/middleware/render.go
index 8a54183135..869ef9abaa 100644
--- a/modules/middleware/render.go
+++ b/modules/middleware/render.go
@@ -242,8 +242,11 @@ func (r *Render) HTMLString(name string, binding interface{}, htmlOpt ...HTMLOpt
}
}
-func (r *Render) Error(status int) {
+func (r *Render) Error(status int, message ...string) {
r.WriteHeader(status)
+ if len(message) > 0 {
+ r.Write([]byte(message[0]))
+ }
}
func (r *Render) Redirect(location string, status ...int) {