Skip to content

Commit 6d779da

Browse files
committed
Remove S3 region is media hostname before matching the media domain
1 parent 6019d3d commit 6d779da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: backends/rapidpro/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ func (b *backend) ResolveMedia(ctx context.Context, mediaUrl string) (courier.Me
679679
mediaUUID := uuidRegex.FindString(u.Path)
680680

681681
// if hostname isn't our media domain, or path doesn't contain a UUID, don't try to resolve
682-
if u.Hostname() != b.config.MediaDomain || mediaUUID == "" {
682+
if strings.Replace(u.Hostname(), fmt.Sprintf("%s.", b.config.S3Region), "", -1) != b.config.MediaDomain || mediaUUID == "" {
683683
return nil, nil
684684
}
685685

0 commit comments

Comments
 (0)