Skip to content

Commit

Permalink
Issue #466: make redirect code more robust
Browse files Browse the repository at this point in the history
Check if the redirect url is not nil.

See #466
  • Loading branch information
magiconair committed Mar 26, 2018
1 parent 0e7043b commit 12ddce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/http_proxy.go
Expand Up @@ -99,7 +99,7 @@ func (p *HTTPProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
RawQuery: r.URL.RawQuery,
}

if t.RedirectCode != 0 {
if t.RedirectCode != 0 && t.RedirectURL != nil {
http.Redirect(w, r, t.RedirectURL.String(), t.RedirectCode)
if t.Timer != nil {
t.Timer.Update(0)
Expand Down

0 comments on commit 12ddce8

Please sign in to comment.