diff --git a/Sources/XMTP/Codecs/RemoteAttachmentCodec.swift b/Sources/XMTP/Codecs/RemoteAttachmentCodec.swift index bfd63fc8..fbb552cb 100644 --- a/Sources/XMTP/Codecs/RemoteAttachmentCodec.swift +++ b/Sources/XMTP/Codecs/RemoteAttachmentCodec.swift @@ -174,11 +174,11 @@ public struct RemoteAttachmentCodec: ContentCodec { throw RemoteAttachmentError.invalidScheme("no scheme parameter") } - guard let scheme = RemoteAttachment.Scheme(rawValue: schemeString) else { - throw RemoteAttachmentError.invalidScheme("invalid scheme value. must be https://") + if (!schemeString.starts(with: "https")) { + throw RemoteAttachmentError.invalidScheme("invalid scheme value. must start with https") } - var attachment = try RemoteAttachment(url: url, contentDigest: contentDigest, secret: secret, salt: salt, nonce: nonce, scheme: scheme) + var attachment = try RemoteAttachment(url: url, contentDigest: contentDigest, secret: secret, salt: salt, nonce: nonce, scheme: RemoteAttachment.Scheme.https) if let contentLength = content.parameters["contentLength"] { attachment.contentLength = Int(contentLength)