Skip to content

[BUG] Underscore in domain part of email are "valid" #503

Open
@sariya23

Description

@sariya23

Bug Report

Q A
Version(s) v0.0.0-20230301143203-a9d515a09cc2

Summary

Underscore in the domain part is recognized as valid

Current behavior

Underscore in the domain part is recognized as valid

How to reproduce

import (
	"fmt"

	"github.com/asaskevich/govalidator"
)

func main() {
	e := "user@do_main.com"
	fmt.Println(govalidator.IsEmail(e)) // true
}

Expected behavior

import (
	"fmt"

	"github.com/asaskevich/govalidator"
)

func main() {
	e := "user@do_main.com"
	fmt.Println(govalidator.IsEmail(e)) // false
}

Info: https://en.wikipedia.org/wiki/Email_address#Domain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions