+3
-3
identity/identity.go
+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
}