Support plain text data URIs

This commit is contained in:
Luke San Antonio 2016-06-15 02:23:09 -04:00
parent da8b5d148c
commit caa24b0513

View File

@ -716,6 +716,11 @@ static bool IsDataURI(const std::string &in) {
return true;
}
header = "data:text/plain;base64,";
if (in.find(header) == 0) {
return true;
}
return false;
}
@ -742,6 +747,13 @@ static bool DecodeDataURI(std::vector<unsigned char> *out,
}
}
if (data.empty()) {
header = "data:text/plain;base64,";
if (in.find(header) == 0) {
data = base64_decode(in.substr(header.size()));
}
}
if (data.empty()) {
return false;
}