optimize
This commit is contained in:
parent
5cc3de8e26
commit
2119199368
@ -69,6 +69,10 @@ func HandleShortUrlRedirect(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "failed to get url", http.StatusInternalServerError)
|
http.Error(w, "failed to get url", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if len(link) == 0 {
|
||||||
|
http.Error(w, "short url get to long url is empty", http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
http.Redirect(w, r, link, http.StatusFound)
|
http.Redirect(w, r, link, http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user