Skip to content

Commit

Permalink
Merge open PR qor#1 by @FlyingShit-XinHuang
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptix committed Jan 6, 2018
2 parents 7636fb6 + ff83789 commit 275539f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions redirect_back.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ func (redirectBack *RedirectBack) RedirectBack(w http.ResponseWriter, req *http.
returnTo := req.Context().Value(returnToKey)

if returnTo != nil {
http.Redirect(w, req, fmt.Sprint(returnTo), http.StatusSeeOther)
return
if returnToStr := fmt.Sprint(returnTo); "" != returnToStr {
http.Redirect(w, req, returnToStr, http.StatusSeeOther)
return
}
}

if referrer := req.Referer(); referrer != "" {
Expand Down

0 comments on commit 275539f

Please sign in to comment.