summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/form.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/context/form.go b/modules/context/form.go
index f9c4ab6a98..5c02152582 100644
--- a/modules/context/form.go
+++ b/modules/context/form.go
@@ -65,3 +65,8 @@ func (ctx *Context) FormOptionalBool(key string) util.OptionalBool {
v = v || strings.EqualFold(s, "on")
return util.OptionalBoolOf(v)
}
+
+func (ctx *Context) SetFormString(key, value string) {
+ _ = ctx.Req.FormValue(key) // force parse form
+ ctx.Req.Form.Set(key, value)
+}