Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/resources/form-post-textplain.php

Issue 2687863002: Fix enctype=text/plain implementation (Closed)
Patch Set: Fix typo Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <?php 1 <?php
2 header("Content-type: text/html; charset=UTF-8"); 2 header("Content-type: text/html; charset=UTF-8");
3 ?> 3 ?>
4 <html> 4 <html>
5 <head> 5 <head>
6 <title>Regression test for bug 20795 and 100445</title> 6 <title>Regression test for bug 20795 and 100445</title>
7 </head> 7 </head>
8 <body> 8 <body>
9 <p> 9 <p>
10 This is a test for 20795 and 100445, it makes sure that forms POSTed with a cont ent-type of text/plain actually send data in text/plain 10 This is a test for 20795 and 100445, it makes sure that forms POSTed with a cont ent-type of text/plain actually send data in text/plain
11 </p> 11 </p>
12 <?php 12 <?php
13 13
14 $content_type = $_SERVER["CONTENT_TYPE"]; 14 $content_type = $_SERVER["CONTENT_TYPE"];
15 15
16 if ($content_type == "text/plain") { 16 if ($content_type == "text/plain") {
17 echo "<p>SUCCESS: Content-type is text/plain.</p>"; 17 echo "<p>SUCCESS: Content-type is text/plain.</p>";
18 } else { 18 } else {
19 echo "<p>FAIL: Content-type should be text/plain, but was '$content_type'</p >"; 19 echo "<p>FAIL: Content-type should be text/plain, but was '$content_type'</p >";
20 } 20 }
21 21
22 $data = file_get_contents("php://input"); 22 $data = file_get_contents("php://input");
23 23
24 if($data == "f1=This is field #1 &!@$%\r\n='<>\r\nf2=This is field #2 \"\"") { 24 if($data == "f1=This is field #1 &!@$%\r\n='<>\r\nf2=This is field #2 \"\"\r\n") {
25 echo "<p>SUCCESS</p>"; 25 echo "<p>SUCCESS</p>";
26 } else { 26 } else {
27 echo "<p>FAILURE: $data</p>"; 27 echo "<p>FAILURE: $data</p>";
28 } 28 }
29 ?> 29 ?>
30 <script> 30 <script>
31 if(window.testRunner) 31 if(window.testRunner)
32 testRunner.notifyDone(); 32 testRunner.notifyDone();
33 </script> 33 </script>
34 </body> 34 </body>
35 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698