summaryrefslogtreecommitdiffstats
path: root/modules/test/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/test/utils.go')
-rw-r--r--modules/test/utils.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/test/utils.go b/modules/test/utils.go
new file mode 100644
index 0000000000..ed1628ab47
--- /dev/null
+++ b/modules/test/utils.go
@@ -0,0 +1,14 @@
+// Copyright 2017 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package test
+
+import (
+ "net/http"
+)
+
+// RedirectURL returns the redirect URL of a http response.
+func RedirectURL(resp http.ResponseWriter) string {
+ return resp.Header().Get("Location")
+}