1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 03:57:10 +00:00

Add test for RedirectTo and fix the wrong-way-to-do-test-with-map-which-keys-some-times-change-order-lol

This commit is contained in:
Makis Maropoulos
2016-07-07 01:20:04 +02:00
parent 01914b6c37
commit 728cba60f7
2 changed files with 48 additions and 26 deletions

View File

@@ -426,7 +426,7 @@ func (ctx *Context) SetHeader(k string, v string) {
// first parameter is the url to redirect
// second parameter is the http status should send, default is 302 (StatusFound), you can set it to 301 (Permant redirect), if that's nessecery
func (ctx *Context) Redirect(urlToRedirect string, statusHeader ...int) {
httpStatus := StatusFound // temporary redirect
httpStatus := StatusFound // a 'temporary-redirect-like' wich works better than for our purpose
if statusHeader != nil && len(statusHeader) > 0 && statusHeader[0] > 0 {
httpStatus = statusHeader[0]
}