From 5339f4c24413271c7df76fcc669610a78e92d07c Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Wed, 7 Feb 2024 00:42:34 +0100 Subject: [PATCH] Change default configuration file and test page. --- config.json | 54 +++-------------------------------------------------- index.html | 54 +++-------------------------------------------------- tests.html | 4 ++-- 3 files changed, 8 insertions(+), 104 deletions(-) diff --git a/config.json b/config.json index a2dd577..4a1ed30 100644 --- a/config.json +++ b/config.json @@ -28,59 +28,11 @@ ] }, { - "definingRegex": "/^\\/invoke500\\/\\?/", + "definingRegex": "/^\\/testdir_rewritten(?:$|[\\/?#])/", "replacements": [ { - "regex": "/\\/invoke500\\/\\?/", - "replacement": "/invoke500.svr?" - } - ] - }, - { - "definingRegex": "/^\\/invoke500\\/.+\\//", - "replacements": [ - { - "regex": "/\\/\\?/", - "replacement": "&" - }, - { - "regex": "/invoke500\\//", - "replacement": "invoke500.svr?" - }, - { - "regex": "/\\/(?!invoke500.svr?)/", - "replacement": "" - } - ] - }, - { - "definingRegex": "/^\\/invoke500\\/.+/", - "replacements": [ - { - "regex": "/\\?/", - "replacement": "&" - }, - { - "regex": "/invoke500\\//", - "replacement": "invoke500.svr?" - } - ] - }, - { - "definingRegex": "/^\\/invoke500\\//", - "replacements": [ - { - "regex": "/\\/invoke500\\//", - "replacement": "/invoke500.svr" - } - ] - }, - { - "definingRegex": "/^\\/invoke500$/", - "replacements": [ - { - "regex": "/\\/invoke500/", - "replacement": "/invoke500.svr" + "regex": "/^\\/testdir_rewritten($|[\\/?#])/", + "replacement": "/testdir$1" } ] } diff --git a/index.html b/index.html index 1fdb812..708c8b3 100644 --- a/index.html +++ b/index.html @@ -54,59 +54,11 @@       ]
    },
    {
-       "definingRegex": "/^\\/invoke500\\/\\?/",
+       "definingRegex": "/^\\/testdir_rewritten(?:$|[\\/?#])/",
      "replacements": [
        {
-           "regex": "/\\/invoke500\\/\\?/",
-           "replacement": "/invoke500.svr?"
-         }
-       ]
-     },
-     {
-       "definingRegex": "/^\\/invoke500\\/.+\\//",
-       "replacements": [
-         {
-           "regex": "/\\/\\?/",
-           "replacement": "&"
-         },
-         {
-           "regex": "/invoke500\\//",
-           "replacement": "invoke500.svr?"
-         },
-         {
-           "regex": "/\\/(?!invoke500.svr?)/",
-           "replacement": ""
-         }
-       ]
-     },
-     {
-       "definingRegex": "/^\\/invoke500\\/.+/",
-       "replacements": [
-         {
-           "regex": "/\\?/",
-           "replacement": "&"
-         },
-         {
-           "regex": "/invoke500\\//",
-           "replacement": "invoke500.svr?"
-         }
-       ]
-     },
-     {
-       "definingRegex": "/^\\/invoke500\\//",
-       "replacements": [
-         {
-           "regex": "/\\/invoke500\\//",
-           "replacement": "/invoke500.svr"
-         }
-       ]
-     },
-     {
-       "definingRegex": "/^\\/invoke500$/",
-       "replacements": [
-         {
-           "regex": "/\\/invoke500/",
-           "replacement": "/invoke500.svr"
+           "regex": "/^\\/testdir_rewritten($|[\\/?#])/",
+           "replacement": "/testdir$1"
        }
      ]
    }
diff --git a/tests.html b/tests.html index 41ef290..d2129ea 100644 --- a/tests.html +++ b/tests.html @@ -32,8 +32,8 @@

Proxy test

-

URL rewriting test (/invoke500/aprilfools => /invoke500.svr?aprilfools)

- +

URL rewriting test (/testdir_rewritten => /testdir)

+