···4747 // TODO: could pull a client or transport from context?
4848 c := http.DefaultClient
49495050- req, err := http.NewRequest("GET", fmt.Sprintf("https://%s/.well-known/atproto-did", handle), nil)
5050+ req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/.well-known/atproto-did", handle), nil)
5151 if err != nil {
5252 return "", err
5353 }
5454- req = req.WithContext(ctx)
55545655 resp, err := c.Do(req)
5756 if err != nil {
···6463 }
6564 return "", fmt.Errorf("failed to resolve handle (%s) through HTTP well-known route: %s", handle, err)
6665 }
6767- if resp.StatusCode != 200 {
6666+ if resp.StatusCode != http.StatusOK {
6867 return "", fmt.Errorf("failed to resolve handle (%s) through HTTP well-known route: status=%d", handle, resp.StatusCode)
6968 }
7069
+2-2
atproto/identity/mock_catalog.go
···52525353func (c *MockCatalog) Lookup(ctx context.Context, a syntax.AtIdentifier) (*Identity, error) {
5454 handle, err := a.AsHandle()
5555- if err == nil {
5555+ if nil == err { // if not an error, is a Handle
5656 return c.LookupHandle(ctx, handle)
5757 }
5858 did, err := a.AsDID()
5959- if err == nil {
5959+ if nil == err { // if not an error, is a DID
6060 return c.LookupDID(ctx, did)
6161 }
6262 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID")