MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / confirmSubscription

Function confirmSubscription

internal/delivery/handler.go:88–103  ·  view source on GitHub ↗

confirmSubscription GETs the (already host-allow-listed) SubscribeURL to confirm the SNS subscription.

(ctx context.Context, client *http.Client, url string)

Source from the content-addressed store, hash-verified

86// confirmSubscription GETs the (already host-allow-listed) SubscribeURL to
87// confirm the SNS subscription.
88func confirmSubscription(ctx context.Context, client *http.Client, url string) error {
89 req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
90 if err != nil {
91 return err
92 }
93 resp, err := client.Do(req)
94 if err != nil {
95 return err
96 }
97 defer resp.Body.Close()
98 io.Copy(io.Discard, io.LimitReader(resp.Body, 64*1024))
99 if resp.StatusCode < 200 || resp.StatusCode >= 300 {
100 return &httpStatusError{resp.StatusCode}
101 }
102 return nil
103}
104
105type httpStatusError struct{ code int }
106

Callers 1

HandlerFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected