Skip to content
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

mime/multipart: Writer option to control boundary string #4490

Closed
eaigner opened this issue Dec 5, 2012 · 8 comments
Closed

mime/multipart: Writer option to control boundary string #4490

eaigner opened this issue Dec 5, 2012 · 8 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@eaigner
Copy link
Contributor

eaigner commented Dec 5, 2012

multipart.Writer has no option for setting a custom boundary and will always use the
internal random boundary.
There should be an option to set the boundary for it, just like with a multipart.Reader.

Proposal:

    func NewWriterBoundary(w io.Writer, boundary string) *Writer
@rsc
Copy link
Contributor

rsc commented Dec 6, 2012

Comment 1:

What is the reason for expanding the API? You say "There should be"
but give no explanation why.

@eaigner
Copy link
Contributor Author

eaigner commented Dec 6, 2012

Comment 2:

Currently I'm parsing multipart data to process it further. In order to restore it from
the parsed/stored state to the original state (thus creating an identical copy) I would
need to be able to set the boundary string to the original.

@eaigner
Copy link
Contributor Author

eaigner commented Dec 6, 2012

Comment 3:

The main reason for this is that a multipart document with base64 encoded parts can take
up more space than necessary.  That's why I don't store the raw multipart data on disk
and need to reconstruct it only if necessary.

@rsc
Copy link
Contributor

rsc commented Dec 9, 2012

Comment 4:

If someone wants to add a SetBoundary method (must be called before first writing
method) that's fine with me. Let's not add a new constructor.

Labels changed: added priority-later, go1.1maybe, removed priority-triage, go1.1.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 5:

Labels changed: added size-s.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 6:

Labels changed: added suggested.

@bradfitz
Copy link
Contributor

Comment 7:

Sent https://golang.org/cl/6924044

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

Comment 8:

This issue was closed by revision 575de93.

Status changed to Fixed.

@eaigner eaigner added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Dec 10, 2012
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

4 participants