-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for verbatim multipart/related S/MIME uploads #135
Comments
Hi @pke , thank you for opening this issue! Indeed, this is a use-case that is not supported by the library; unfortunately your suggested workaround won't work, because the As I see it, there are two ways to facilitate what you're looking for:
If I understand you correctly, you're suggesting (1)? Personally I'm leaning towards (2), since it fits better with the current premise of the library, which is to aid in building requests. Would (2) be a workable compromise for your needs or am I missing a crucial detail? |
Thanks for your quick an thorough response. I need this for S/MIME uploads. But I think that's out of scope for this lib. It could however help in composition of the multi layered related parts. Below you find a typical body of such message. The "smime.signed" is its own multipart inside the wrapping "smime.parts" part.
Especially for big files the requirement of S/MIME to encode the attachments in BASE64 makes it less than ideal in an app world, where this increases the apps memory consumption a lot (base64 being 1.3 bigger than the binary data). I am not sure about the S/MIME protocol if the signing parts could also be sent last? Does this make sense? I think for now I could also just not use the multipart feature and upload the body as I have it already prepared? |
Your comment makes total sense to me, and I think it would be a nice feature to add to the library. I'm still pondering what solution to go with though. As for your suggested workaround: every upload request is mapped to a multipart body, so this won't work. This is what happens: const request0 = {
absoluteFilePath,
method: 'POST',
mimeType: 'multipart/related; boundary="===============smime.parts=="',
url: 'http://192.168.0.147:8080',
};
const uploadResult = await BlobCourier.uploadBlob(request0)
It makes a good point for the I'll let you know what I decide on soon! |
Closing this in favor of the issues mentioned in my last coment. |
The library already supports 2 variants of multipart uploads, which covers most use-cases.
I have a third use-case now and wonder if this can be already done with the library or would become a feature request.
I have to upload S/MIME
multipart/related
bodies which I already prepare myself and place them in the apps storage folder like thisYYYYMMDDHHMMSSMS-<guid>.upload
The content of this file is themultipart/related
body that needs to be uploaded. It must not be base64 encoded or anything.Does this already work when pointing the request to this local file and setting the
Content-Type
header tomultipart/related
?The text was updated successfully, but these errors were encountered: