You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an Entity.Reader function which returns an io.Reader for the entity. This would allow users to read a header, inspect it and then forward the reader to someone else.
Ideally this wouldn't decode and re-encode the body: we'd save the original io.Reader. That can only work if the headers aren't modified.
Bonus points if message.Read can be optimized in case it's passed the result of an Entity.Reader call (just like we have for NewMultipart and Entity.MultipartReader).
The text was updated successfully, but these errors were encountered:
One open question is how to handle encoding/charset conversions, if at all.
Currently we allow library users to perform encoding/charset conversions by mutating the Entity.Header and using Entity.WriteTo. This won't work with Entity.Reader, because the encoding logic is io.Writer-based.
Add an
Entity.Reader
function which returns anio.Reader
for the entity. This would allow users to read a header, inspect it and then forward the reader to someone else.Ideally this wouldn't decode and re-encode the body: we'd save the original
io.Reader
. That can only work if the headers aren't modified.Bonus points if
message.Read
can be optimized in case it's passed the result of anEntity.Reader
call (just like we have forNewMultipart
andEntity.MultipartReader
).The text was updated successfully, but these errors were encountered: