+3
-3
identity/identity.go
+3
-3
identity/identity.go
···
33
}
34
35
func ResolveHandleFromWellKnown(ctx context.Context, cli *http.Client, handle string) (string, error) {
36
-
ustr := fmt.Sprintf("https://%s/.well=known/atproto-did", handle)
37
req, err := http.NewRequestWithContext(
38
ctx,
39
"GET",
···
92
func DidToDocUrl(did string) (string, error) {
93
if strings.HasPrefix(did, "did:plc:") {
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
97
} else {
98
return "", fmt.Errorf("did was not a supported did type")
99
}
···
33
}
34
35
func ResolveHandleFromWellKnown(ctx context.Context, cli *http.Client, handle string) (string, error) {
36
+
ustr := fmt.Sprintf("https://%s/.well-known/atproto-did", handle)
37
req, err := http.NewRequestWithContext(
38
ctx,
39
"GET",
···
92
func DidToDocUrl(did string) (string, error) {
93
if strings.HasPrefix(did, "did:plc:") {
94
return fmt.Sprintf("https://plc.directory/%s", did), 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
} else {
98
return "", fmt.Errorf("did was not a supported did type")
99
}