An atproto PDS written in Go

fix typo in wellknown url (#24)

authored by hailey.at and committed by GitHub 9d97b6b9 9a59a94b

Changed files
+3 -4
identity
+3 -3
identity/identity.go
··· 33 33 } 34 34 35 35 func ResolveHandleFromWellKnown(ctx context.Context, cli *http.Client, handle string) (string, error) { 36 - ustr := fmt.Sprintf("https://%s/.well=known/atproto-did", handle) 36 + ustr := fmt.Sprintf("https://%s/.well-known/atproto-did", handle) 37 37 req, err := http.NewRequestWithContext( 38 38 ctx, 39 39 "GET", ··· 92 92 func DidToDocUrl(did string) (string, error) { 93 93 if strings.HasPrefix(did, "did:plc:") { 94 94 return fmt.Sprintf("https://plc.directory/%s", did), nil 95 - } else if strings.HasPrefix(did, "did:web:") { 96 - return fmt.Sprintf("https://%s/.well-known/did.json", strings.TrimPrefix(did, "did:web:")), nil 95 + } else if after, ok := strings.CutPrefix(did, "did:web:"); ok { 96 + return fmt.Sprintf("https://%s/.well-known/did.json", after), nil 97 97 } else { 98 98 return "", fmt.Errorf("did was not a supported did type") 99 99 }
-1
identity/passport.go
··· 46 46 } 47 47 } 48 48 49 - // TODO: should coalesce requests here 50 49 doc, err := FetchDidDoc(ctx, p.h, did) 51 50 if err != nil { 52 51 return nil, err