Fix for atproto.brid.gy being treated as not whitelisted due to not matching "https://*" glob pattern

main
Max Ignatenko 2024-05-21 08:58:37 +01:00
parent a9076c44c0
commit 9283a841b4
1 changed files with 5 additions and 0 deletions

View File

@ -71,6 +71,11 @@ func EnsureExists(ctx context.Context, db *gorm.DB, did string) (*Repo, bool, er
if err != nil {
return nil, false, fmt.Errorf("fetching DID Document: %w", err)
}
if u.Path == "/" {
// Discard inginificant path to avoid string comparison mismatches,
// as well as glob pattern false negatives.
u.Path = ""
}
remote, err := pds.EnsureExists(ctx, db, u.String())
if err != nil {