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
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.
The text was updated successfully, but these errors were encountered:
Fixes Or Enhances go-playground#518.
Make sure that you've checked the boxes below before you submit PR:
[x] Tests exist or have been written that cover this particular change.
Change Details:
The datauri validation was not allowing certain valid strings; this
commit updates the regex to meet RFC 2397. I drew heavily on this gist
https://gist.github.com/khanzadimahdi/bab8a3416bdb764b9eda5b38b35735b8,
but had to make a few updates to remove some negative lookaheads (which
Go doesn't allow afaik), and to account for the way the `isDataURI`
function works - it validates the base64 separately from the other parts
of the uri.
@go-playground/admins
Fixes Or Enhances go-playground#518.
Make sure that you've checked the boxes below before you submit PR:
[x] Tests exist or have been written that cover this particular change.
Change Details:
The datauri validation was not allowing certain valid strings; this
commit updates the regex to meet RFC 2397. I drew heavily on this gist
https://gist.github.com/khanzadimahdi/bab8a3416bdb764b9eda5b38b35735b8,
but had to make a few updates to remove some negative lookaheads (which
Go doesn't allow afaik), and to account for the way the `isDataURI`
function works - it validates the base64 separately from the other parts
of the uri.
@go-playground/admins
Package version eg. v8, v9:
master
Code sample, to showcase or reproduce:
Prints
false
it should printtrue
.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.The text was updated successfully, but these errors were encountered: