Skip to content

Content type automatically added by Mt.multipart #64

@lyrm

Description

@lyrm

This issue is about the two following functions of the Mt module :

val multipart : rng:'g rng -> ?header:Header.t -> ?boundary:string -> part list -> multipart
val make : Header.t -> 'x body -> 'x -> t

There are two ways of building the "same" email with predefined header header.

More intuitive choice

let mail = 
   Mt.multipart ~rng:Mt.rng parts 
   |> Mt.make header Mt.multi

Second choice

let mail = 
   Mt.multipart ~header ~rng:Mt.rng parts 
   |> Mt.make Header.empty Mt.multi

The issue is the following: the multipart function checks the input header for the content type and adds it if necessary. So the first solution does not work properly : the final headers can have multiple content-type headers (the one in the predefined header and the added one).

But the first solution is clearly suggested by the API as header is an optional argument for multipart but not for make.

I think an easy solution will be to remove the header argument of the make function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions