qdataurl: extend the unittests
Check: - data: urls with a host are treated as malformed - if the mime type is omitted, it's set to "text/plain;charset=US-ASCII" as per the RFC[1] - the mime type of urls with a `charset` attribute are normalized by adding "text/plain;" (Qt implementation detail) if it's missing [1] https://www.rfc-editor.org/rfc/rfc2397.html Pick-to: 6.8 6.5 5.15 Change-Id: Ifd9736b7808226c8462e3d39798abda7b245c6d8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f8987b2d0a0835bdc2e6e4f2204e6e40db33da5f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
845aa1e9d1
commit
679dc18c43
@ -28,8 +28,15 @@ void tst_QDataUrl::decode_data()
|
||||
};
|
||||
|
||||
row("nonData", "http://test.com", false);
|
||||
row("malformed-host", "data://test.com", false);
|
||||
row("malformed-host2", "data://text/plain;charset=ISO-8859-1", false);
|
||||
row("malformed-host3", "data://test.com/,", false);
|
||||
row("emptyData", "data:text/plain", true,
|
||||
"text/plain;charset=US-ASCII"_L1);
|
||||
row("emptyData-default-mimetype", "data:,", true,
|
||||
"text/plain;charset=US-ASCII"_L1, "");
|
||||
row("emptyData-only-charset", "data:charset=ISO-8859-1,", true,
|
||||
"text/plain;charset=ISO-8859-1"_L1, "");
|
||||
row("alreadyPercentageEncoded", "data:text/plain,%E2%88%9A", true,
|
||||
"text/plain"_L1, QByteArray::fromPercentEncoding("%E2%88%9A"));
|
||||
row("everythingIsCaseInsensitive", "Data:texT/PlaiN;charSet=iSo-8859-1;Base64,SGVsbG8=", true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user