forked from AkkomaGang/constanze
Fix segfault on scheme-less instance URL
Since it cannot connect at all, there’s never a response to look into. Even with --debug this is hard to spot in current logs prior to the segfault.
This commit is contained in:
parent
372b8ec304
commit
1949ae2874
1 changed files with 2 additions and 1 deletions
3
http.go
3
http.go
|
|
@ -15,9 +15,10 @@ func Post(url string, body interface{}) (*http.Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonBody))
|
||||
log.Debugf("Status: %d", resp.StatusCode)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect: %s", err)
|
||||
return nil, err
|
||||
}
|
||||
log.Debugf("Status: %d", resp.StatusCode)
|
||||
return resp, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue