Skip to content
Permalink
Browse files

(path): Remove old path chaining fallback tests

  • Loading branch information
erbesharat committed Oct 21, 2019
1 parent 8adbe4b commit 79ac048ee10f04760cb97895286ff4bf3f3f183d
Showing with 1 addition and 9 deletions.
  1. +0 −7 fallback_test.go
  2. +1 −1 path.go
  3. +0 −1 txtdirect_test.go
@@ -103,13 +103,6 @@ func Test_fallbackE2E(t *testing.T) {
redirect string
headers http.Header
}{
{
url: "https://fallbackpath.test/to",
enable: []string{"path"},
code: 302,
to: "https://to.works.fine.test",
headers: http.Header{},
},
{
url: "https://fallbackpath.test",
enable: []string{"www"},
@@ -234,7 +234,7 @@ func zoneFromPath(r *http.Request, rec record) (string, int, []string, error) {
}
*r = *r.WithContext(context.WithValue(r.Context(), "regexMatches", pathSlice))
if len(pathSlice) < 1 && rec.Re != "" {
log.Printf("<%s> [txtdirect]: custom regex doesn't work on %s", time.Now().String(), path)
return "", 0, []string{}, fmt.Errorf("custom regex doesn't work on %s", path)
}
from := len(pathSlice)
if rec.From != "" {
@@ -67,7 +67,6 @@ var txts = map[string]string{

// type=path
"_redirect.fallbackpath.test.": "v=txtv0;type=path;code=302;to=https://to.works.fine.test",
"_redirect.to.fallbackpath.test.": "v=txtv0;type=path;to=https://to.works.fine.test;code=302",
"_redirect.refrom.fallbackpath.test.": "v=txtv0;type=path;re=exist;from=$1$2;to=https://to.works.fine.test;code=302",
"_redirect.lenfrom.test.": "v=txtv0;type=path;from=$1$2$3;to=https://lenfrom.fallback.test;code=302",

0 comments on commit 79ac048

Please sign in to comment.
You can’t perform that action at this time.