mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
add prefixes
This commit is contained in:
@@ -48,7 +48,7 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make new request
|
// make new request
|
||||||
log.Printf("Calling: %v", apiURL+"?shortURL="+uri.String())
|
log.Printf("[url/proxy] Calling: %v", apiURL+"?shortURL="+uri.String())
|
||||||
req, err := http.NewRequest("GET", apiURL+"?shortURL="+uri.String(), nil)
|
req, err := http.NewRequest("GET", apiURL+"?shortURL="+uri.String(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
@@ -79,7 +79,7 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if rsp.StatusCode != 200 {
|
if rsp.StatusCode != 200 {
|
||||||
log.Printf("Error calling api: status: %v %v", rsp.StatusCode, string(b))
|
log.Printf("[url/proxy] Error calling api: status: %v %v", rsp.StatusCode, string(b))
|
||||||
http.Error(w, "unexpected error", 500)
|
http.Error(w, "unexpected error", 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user