blob: 24cc4af2eb3bfb082329ee768075421088120691 [file] [log] [blame]
<html>
<head>
<title>Regression test for bug 20795</title>
</head>
<body>
<p>This is a negative test for https://bugs.webkit.org/show_bug.cgi?id=20795, it makes sure that forms submitted using GET with a content-type of text/plain actually send data in URL encoded in the URL</p>
<form enctype="text/plain" method="get" action="?" name="f">
<input type="hidden" name="f1" value="This is field #1 &!@$%\n='<>">
<input type="hidden" name="f2" value='This is field #2 ""'>
<input type="submit" value="press me">
</form>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (document.URL.substring(0, 4) == "file") {
if (document.URL.indexOf('?') == -1) {
document.f.submit();
} else {
document.f.style.display="none";
if (document.URL.substring(document.URL.indexOf('?')+1, document.URL.length) == "f1=This+is+field+%231+%26%21%40%24%25%5Cn%3D%27%3C%3E&f2=This+is+field+%232+%22%22")
document.write("<p>Success</p>");
else
document.write("<p>Failure: (" + document.URL + ")</p>");
if (window.testRunner)
testRunner.notifyDone();
}
} else {
document.write("<p>This test doesn't work directly from bugzilla, please save it to a local file first.</p>");
}
</script>
</body>
</html>