diff --git a/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh b/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh index 1538bddbec241..a31ce6810d33c 100755 --- a/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh +++ b/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh @@ -116,6 +116,22 @@ gen-signedexchange \ -o sxg-utf8-inner-url.sxg \ -miRecordSize 100 +# Fallback URL has invalid UTF-8 sequence. +gen-signedexchange \ + -version 1b2 \ + -ignoreErrors \ + -uri "$inner_url_origin/signed-exchange/resources/$(echo -e '\xce\xce\xa9').html" \ + -status 200 \ + -content sxg-location.html \ + -certificate $certfile \ + -certUrl $cert_url_origin/signed-exchange/resources/$certfile.cbor \ + -validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \ + -privateKey $keyfile \ + -date 2018-04-01T00:00:00Z \ + -expire 168h \ + -o sxg-invalid-utf8-inner-url.sxg \ + -miRecordSize 100 + # Fallback URL has UTF-8 BOM. gen-signedexchange \ -version 1b2 \ diff --git a/testing/web-platform/tests/signed-exchange/resources/sxg-invalid-utf8-inner-url.sxg b/testing/web-platform/tests/signed-exchange/resources/sxg-invalid-utf8-inner-url.sxg new file mode 100644 index 0000000000000..1f697b74b0d78 Binary files /dev/null and b/testing/web-platform/tests/signed-exchange/resources/sxg-invalid-utf8-inner-url.sxg differ diff --git a/testing/web-platform/tests/signed-exchange/resources/sxg-invalid-utf8-inner-url.sxg.headers b/testing/web-platform/tests/signed-exchange/resources/sxg-invalid-utf8-inner-url.sxg.headers new file mode 100644 index 0000000000000..ca41178420c5b --- /dev/null +++ b/testing/web-platform/tests/signed-exchange/resources/sxg-invalid-utf8-inner-url.sxg.headers @@ -0,0 +1,2 @@ +Content-Type: application/signed-exchange;v=b2 +X-Content-Type-Options: nosniff diff --git a/testing/web-platform/tests/signed-exchange/sxg-invalid-utf8-inner-url.tentative.html b/testing/web-platform/tests/signed-exchange/sxg-invalid-utf8-inner-url.tentative.html new file mode 100644 index 0000000000000..bc28d8101cc7a --- /dev/null +++ b/testing/web-platform/tests/signed-exchange/sxg-invalid-utf8-inner-url.tentative.html @@ -0,0 +1,24 @@ + +SignedHTTPExchange's fallback url must not have invalid UTF-8 sequence + + + + + + +