Skip to content

datauri fails to accept valid data URIs. #518

Open
@puellanivis

Description

@puellanivis

Package version eg. v8, v9:

master

Code sample, to showcase or reproduce:

fmt.Println(dataURIRegex.MatchString(`data:,ohai`)

Prints false it should print true.

This is an inherited problem from every other validation library out there. This same regex keeps getting copied around.

Wikipedia gives a pretty clear guidance about what a valid Data URI is: data:[<media type>][;base64],<data> note the optional state of <media type> and even of the ;base64 element, and the requirement of a comma.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions