aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/devtest/devtest.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/devtest/devtest.go')
-rw-r--r--routers/web/devtest/devtest.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/routers/web/devtest/devtest.go b/routers/web/devtest/devtest.go
index 64b732c035..525ca9be53 100644
--- a/routers/web/devtest/devtest.go
+++ b/routers/web/devtest/devtest.go
@@ -34,7 +34,7 @@ func List(ctx *context.Context) {
func FetchActionTest(ctx *context.Context) {
_ = ctx.Req.ParseForm()
- ctx.Flash.Info(ctx.Req.Method + " " + ctx.Req.RequestURI + "<br>" +
+ ctx.Flash.Info("fetch-action: " + ctx.Req.Method + " " + ctx.Req.RequestURI + "<br>" +
"Form: " + ctx.Req.Form.Encode() + "<br>" +
"PostForm: " + ctx.Req.PostForm.Encode(),
)
@@ -52,5 +52,15 @@ func Tmpl(ctx *context.Context) {
ctx.Data["TimePast1y"] = now.Add(-1 * 366 * 86400 * time.Second)
ctx.Data["TimeFuture1y"] = now.Add(1 * 366 * 86400 * time.Second)
+ if ctx.Req.Method == "POST" {
+ _ = ctx.Req.ParseForm()
+ ctx.Flash.Info("form: "+ctx.Req.Method+" "+ctx.Req.RequestURI+"<br>"+
+ "Form: "+ctx.Req.Form.Encode()+"<br>"+
+ "PostForm: "+ctx.Req.PostForm.Encode(),
+ true,
+ )
+ time.Sleep(2 * time.Second)
+ }
+
ctx.HTML(http.StatusOK, base.TplName("devtest"+path.Clean("/"+ctx.Params("sub"))))
}