From c571ac6fd3b6c0685c060613389e8ce094da31d5 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 20 Sep 2022 11:37:24 +0200 Subject: [PATCH] Allow uppercase ASCII alphabet in PyPI package names (#21095) (#21217) Backport of #21095 Co-authored-by: Lunny Xiao --- routers/api/packages/pypi/pypi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/packages/pypi/pypi.go b/routers/api/packages/pypi/pypi.go index 9209c4edd5..bb2208e01e 100644 --- a/routers/api/packages/pypi/pypi.go +++ b/routers/api/packages/pypi/pypi.go @@ -24,7 +24,7 @@ import ( // https://www.python.org/dev/peps/pep-0503/#normalized-names var normalizer = strings.NewReplacer(".", "-", "_", "-") -var nameMatcher = regexp.MustCompile(`\A[a-z0-9\.\-_]+\z`) +var nameMatcher = regexp.MustCompile(`\A[a-zA-Z0-9\.\-_]+\z`) // https://www.python.org/dev/peps/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions var versionMatcher = regexp.MustCompile(`^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$`)