diff --git a/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/processors/ERS3AttachmentProcessor.java b/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/processors/ERS3AttachmentProcessor.java index 335512be70c..f2183d761fd 100644 --- a/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/processors/ERS3AttachmentProcessor.java +++ b/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/processors/ERS3AttachmentProcessor.java @@ -12,6 +12,8 @@ import java.util.Map; import java.util.TreeMap; +import org.apache.commons.lang.StringUtils; + import com.amazon.s3.AWSAuthConnection; import com.amazon.s3.Response; import com.silvasoftinc.s3.S3StreamObject; @@ -148,6 +150,10 @@ public String attachmentUrl(ERS3Attachment attachment, WORequest request, e); } + } else if(request.isSecure()) { + // The attachment is not proxied. So, the URL must be fixed if the request is secure. + attachmentUrl = StringUtils.replaceOnce(attachmentUrl, "http://", "https://"); + attachmentUrl = StringUtils.replaceOnce(attachmentUrl, ":80/", "/"); } return attachmentUrl;