diff options
| author | RblSb <msrblsb@gmail.com> | 2022-03-09 19:12:44 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2022-03-09 19:25:36 +0300 |
| commit | bb525795172fee119d8029addea4da173c3f9455 (patch) | |
| tree | 701dcda96a9383d02a7e1b617e61fb0e37007e95 /test | |
| parent | e48c2be14fb1474beb1993cd09e4f42aec51b1a8 (diff) | |
Improve url handling
Diffstat (limited to 'test')
| -rw-r--r-- | test/tests/TestServer.hx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/tests/TestServer.hx b/test/tests/TestServer.hx index 01d0c56..bbb1d9a 100644 --- a/test/tests/TestServer.hx +++ b/test/tests/TestServer.hx @@ -22,24 +22,27 @@ class TestServer extends Test { server.onServerInited = () -> { final url = 'http://${server.localIp}:${server.port}'; request('$url/你好,世界!@$^&*)_+-=', data -> { - Assert.equals("File 你好,世界!@$^&*)_+-= not found.", data); + Assert.equals("File 你好,世界!@$^&*)_ -= not found.", data); }); request('$url/Привет%00мир!', data -> { Assert.equals("File Приветмир! not found.", data); }); request('$url/Ы%ы%00ы!', data -> { - Assert.equals("File %D0%AB%%D1%8B%00%D1%8B! not found.", data); + Assert.equals("<!DOCTYPE html>", data.split("\n")[0]); }); request('$url/video/skins/default.php?dir_inc=/etc/passwd%00', data -> { - var line = "File video/skins/default.php?dir_inc=/etc/passwd not found."; + var line = "File video/skins/default.php not found."; if (Sys.systemName() == "Windows") line = line.replace("/", "\\"); Assert.equals(line, data); }); request('$url/%20', data -> { - Assert.equals("File not found.", data); + Assert.equals("<!DOCTYPE html>", data.split("\n")[0]); }); request('$url/build/../../server.js', data -> { Assert.equals("File server.js not found.", data); + }); + request('$url/?meh', data -> { + Assert.equals("<!DOCTYPE html>", data.split("\n")[0]); async.done(); }); } |
