PiBa-NL | 4dc3f3b | 2018-12-23 21:21:51 +0100 | [diff] [blame] | 1 | |
| 2 | local data = "abcdefghijklmnopqrstuvwxyz" |
| 3 | local responseblob = "" |
| 4 | for i = 1,10000 do |
| 5 | responseblob = responseblob .. "\r\n" .. i .. data:sub(1, math.floor(i % 27)) |
| 6 | end |
| 7 | |
| 8 | http01applet = function(applet) |
| 9 | local response = responseblob |
| 10 | applet:set_status(200) |
| 11 | applet:add_header("Content-Type", "application/javascript") |
| 12 | applet:add_header("Content-Length", string.len(response)*10) |
| 13 | applet:start_response() |
| 14 | for i = 1,10 do |
| 15 | applet:send(response) |
| 16 | end |
| 17 | end |
| 18 | |
| 19 | core.register_service("fileloader-http01", "http", http01applet) |