Skip to content

Conversation

@matti
Copy link
Contributor

@matti matti commented Apr 26, 2021

again, cloudmailin decided to send string instead of an array. now this handles both cases (ugly as f)

@matti
Copy link
Contributor Author

matti commented Apr 26, 2021

ACTUALLY also headers.dkim_signature can be string or array

I have no idea how to do this cleanly with go - prob not with json.NewDecoder - I just removed the dkim_signature headers in my version.

@peterhellberg
Copy link
Owner

peterhellberg commented Apr 28, 2021

I’d probably write a custom UnmarshalJSON and decode the problematic fields into json.RawMessage and then decode those into appropriate types, and in the end populating slices regardless if getting a single string or not.

@matti
Copy link
Contributor Author

matti commented Apr 28, 2021

yep, if I only had energy to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants