| OLD | NEW |
| 1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
| 2 | 2 |
| 3 # This script outputs a broken transfer-encoded response. In order to deliver |
| 4 # didReceiveResponse to the client (i.e. XHR), we send a small valid chunk |
| 5 # first, wait a while and then send an invalid chunk. |
| 6 |
| 3 use IO::Socket; | 7 use IO::Socket; |
| 4 | 8 |
| 5 $| = 1; | 9 $| = 1; |
| 6 | 10 |
| 7 autoflush STDOUT 1; | 11 autoflush STDOUT 1; |
| 8 | 12 |
| 9 print "Content-Type: text/html; charset=us-ascii\n"; | 13 print "Content-Type: text/html; charset=us-ascii\n"; |
| 14 print "X-Content-Type-Options: nosniff\n"; |
| 10 print "Transfer-encoding: chunked\n\n"; | 15 print "Transfer-encoding: chunked\n\n"; |
| 11 | 16 |
| 17 print "5\nhello\n"; |
| 12 sleep 2; | 18 sleep 2; |
| 13 | 19 |
| 14 print "hoge\nfuga\n"; | 20 print "hoge\nfuga\n"; |
| OLD | NEW |