Skip to content

Commit

Permalink
Merge branch 'main' into rich/update-podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer authored Oct 5, 2023
2 parents 955b458 + a288cf7 commit b004c85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/XMTP/Codecs/RemoteAttachmentCodec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b004c85

Please sign in to comment.