summaryrefslogtreecommitdiff
path: root/internal/transport/derefinstance.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-02-18 16:02:19 +0000
committerLibravatar GitHub <noreply@github.com>2023-02-18 17:02:19 +0100
commita684fc46288e38a7e1d3555cb9a5a48b8c65b634 (patch)
tree78f49cdef331979fd7c0bb20f9014515176e9117 /internal/transport/derefinstance.go
parent[chore]: Bump golang.org/x/net from 0.5.0 to 0.7.0 (#1523) (diff)
downloadgotosocial-a684fc46288e38a7e1d3555cb9a5a48b8c65b634.tar.xz
[chore] transport improvements (#1524)
* improve error readability, mark "bad hosts" as fastFail Signed-off-by: kim <grufwub@gmail.com> * pull in latest go-byteutil version with byteutil.Reader{} Signed-off-by: kim <grufwub@gmail.com> * use rewindable body reader for post requests Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/transport/derefinstance.go')
-rw-r--r--internal/transport/derefinstance.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/transport/derefinstance.go b/internal/transport/derefinstance.go
index e46b52554..2dcf367a0 100644
--- a/internal/transport/derefinstance.go
+++ b/internal/transport/derefinstance.go
@@ -102,7 +102,7 @@ func dereferenceByAPIV1Instance(ctx context.Context, t *transport, iri *url.URL)
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("GET request to %s failed (%d): %s", iriStr, resp.StatusCode, resp.Status)
+ return nil, fmt.Errorf("GET request to %s failed: %s", iriStr, resp.Status)
}
b, err := io.ReadAll(resp.Body)
@@ -252,7 +252,7 @@ func callNodeInfoWellKnown(ctx context.Context, t *transport, iri *url.URL) (*ur
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("callNodeInfoWellKnown: GET request to %s failed (%d): %s", iriStr, resp.StatusCode, resp.Status)
+ return nil, fmt.Errorf("callNodeInfoWellKnown: GET request to %s failed: %s", iriStr, resp.Status)
}
b, err := io.ReadAll(resp.Body)
@@ -303,7 +303,7 @@ func callNodeInfo(ctx context.Context, t *transport, iri *url.URL) (*apimodel.No
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("callNodeInfo: GET request to %s failed (%d): %s", iriStr, resp.StatusCode, resp.Status)
+ return nil, fmt.Errorf("callNodeInfo: GET request to %s failed: %s", iriStr, resp.Status)
}
b, err := io.ReadAll(resp.Body)