diff --git a/go-plugins/cmd/go-runner/plugins/try_path.go b/go-plugins/cmd/go-runner/plugins/try_path.go index 9f2cb1e..335bdf3 100644 --- a/go-plugins/cmd/go-runner/plugins/try_path.go +++ b/go-plugins/cmd/go-runner/plugins/try_path.go @@ -83,8 +83,8 @@ func tryPath(host, path string) (bool, error) { return false, err } defer resp.Body.Close() - if resp.StatusCode != 404 && resp.StatusCode != 403 { - return true, nil + if resp.StatusCode == 404 || resp.StatusCode == 403 || resp.StatusCode == 400 || resp.Header.Get("Content-Type") == "folder" { + return false, nil } - return false, nil + return true, nil } diff --git a/go-plugins/plugins.md b/go-plugins/plugins.md index a99d308..65cbae0 100644 --- a/go-plugins/plugins.md +++ b/go-plugins/plugins.md @@ -14,6 +14,6 @@ value: value is a string (serialized JSON object) that contains `paths` and `hos ```json { "name": "try-path", - "value": "{\"path\":[\"$uri\",\"$uri/\",\"index.html\"],\"host\":\"http://hostname\"}" + "value": "{\"paths\":[\"$uri\", \"$uri/\", \"$uriindex.html\", \"$uri/index.html\"], \"host\":\"http://hostname\"}" } ``` \ No newline at end of file