feat(web-proxy): throw error when trying to access apiv1 on apiv2

This commit is contained in:
spiral
2022-12-03 12:00:41 +00:00
parent 372eef72f4
commit 8a727c6e80
2 changed files with 26 additions and 0 deletions

View File

@@ -63,3 +63,12 @@ func requireEnv(key string) string {
return val
}
}
func is_trying_to_use_v1_path_on_v2(path string) bool {
return strings.HasPrefix(path, "/v2/s/") ||
strings.HasPrefix(path, "/v2/m/") ||
strings.HasPrefix(path, "/v2/a/") ||
strings.HasPrefix(path, "/v2/msg/") ||
path == "/v2/s" ||
path == "/v2/m"
}