fix: return after writing 500 http headers

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2024-06-22 22:05:52 +03:00
parent fc458f1cda
commit 064fdfe180
Signed by: Hesham
GPG Key ID: 74876157D199B09E

View File

@ -60,12 +60,14 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {
if err != nil { if err != nil {
log.Println(err.Error()) log.Println(err.Error())
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
return
} }
err = writeFormattedIP(w, Type, ip) err = writeFormattedIP(w, Type, ip)
if err != nil { if err != nil {
log.Println(err.Error()) log.Println(err.Error())
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
return
} }
} }