Owen Rudge : winetest: Add a script to test HTTP redirection limits.
Alexandre Julliard
julliard at winehq.org
Thu Jul 2 14:55:03 CDT 2020
Module: tools
Branch: master
Commit: 9d2c746f26516640189d68e3a59b70f44842364b
URL: https://source.winehq.org/git/tools.git/?a=commit;h=9d2c746f26516640189d68e3a59b70f44842364b
Author: Owen Rudge <orudge at codeweavers.com>
Date: Mon Jun 29 22:44:04 2020 +0100
winetest: Add a script to test HTTP redirection limits.
I've written patches to implement support for
WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS in winhttp; this script will
be required for the tests.
Signed-off-by: Owen Rudge <orudge at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
winetest/tests/redirecttest.php | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/winetest/tests/redirecttest.php b/winetest/tests/redirecttest.php
new file mode 100644
index 0000000..e9f8995
--- /dev/null
+++ b/winetest/tests/redirecttest.php
@@ -0,0 +1,17 @@
+<?php
+
+$id = (int)$_GET['id'];
+$max = max(0, min(15, (int)$_GET['max']));
+
+if ($id < 0)
+ $id = 0;
+
+if ($id < $max)
+{
+ $new_url = sprintf("%s://%s%s?id=%d&max=%d", $_SERVER['REQUEST_SCHEME'], $_SERVER['HTTP_HOST'], $_SERVER['SCRIPT_NAME'], $id + 1, $max);
+ Header("Location: " . $new_url);
+}
+
+Header("Content-Type: text/plain");
+echo($id);
+?>
More information about the wine-cvs
mailing list