Allow to use : in domain for testing
ivaaaan opened this issue · 2 comments
ivaaaan commented
Hey. I'm trying to write a test using a mailgun mock server:
mailgunServer := mailgun.NewMockServer()
mailgunClient := mailgun.NewMailgun(mailgunServer.URL(), "")
However, I'm getting an error from this place:
https://github.com/mailgun/mailgun-go/blob/master/messages.go#L557:
invalidChars := ":&'@(),!?#;%+=<>"
if i := strings.ContainsAny(mg.domain, invalidChars); i {
err = fmt.Errorf("you called Send() with a domain that contains invalid characters")
return
}
Can we allow :
in the domain for testing purposes? I can create a PR if needed
thrawn01 commented
Sorry for the late reply, but yes, I think that is appropriate change to make.