aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2019-04-14 21:25:55 +0200
committerPřemysl Janouch <p@janouch.name>2019-04-14 21:25:55 +0200
commit39e2c5b76d264904d34aec3e67665de816dfec4a (patch)
treed9e2d1c6d7b42f5f4c0060444c6e9c7b47bea92e
parentea45784554bb02a107b6fdbcd8a352ff1197e08f (diff)
downloadsklad-39e2c5b76d264904d34aec3e67665de816dfec4a.tar.gz
sklad-39e2c5b76d264904d34aec3e67665de816dfec4a.tar.xz
sklad-39e2c5b76d264904d34aec3e67665de816dfec4a.zip
sklad: don't post-login redirect to POST requests
-rw-r--r--sklad/session.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/sklad/session.go b/sklad/session.go
index 0d0686a..02fe0b0 100644
--- a/sklad/session.go
+++ b/sklad/session.go
@@ -51,7 +51,7 @@ func sessionWrap(inner func(http.ResponseWriter, *http.Request)) func(
w.Header().Set("Cache-Control", "no-store")
redirect := "/login"
- if r.RequestURI != "/" {
+ if r.RequestURI != "/" && r.Method == http.MethodGet {
redirect += "?redirect=" + url.QueryEscape(r.RequestURI)
}