mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	Allow local package identifiers for PyPI packages (#21690)
Fixes #21683 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -29,7 +29,7 @@ func TestPackagePyPI(t *testing.T) { | ||||
| 	user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) | ||||
|  | ||||
| 	packageName := "test-package" | ||||
| 	packageVersion := "1.0.1" | ||||
| 	packageVersion := "1.0.1+r1234" | ||||
| 	packageAuthor := "KN4CK3R" | ||||
| 	packageDescription := "Test Description" | ||||
|  | ||||
| @@ -164,7 +164,7 @@ func TestPackagePyPI(t *testing.T) { | ||||
| 		nodes := htmlDoc.doc.Find("a").Nodes | ||||
| 		assert.Len(t, nodes, 2) | ||||
|  | ||||
| 		hrefMatcher := regexp.MustCompile(fmt.Sprintf(`%s/files/%s/%s/test\..+#sha256-%s`, root, packageName, packageVersion, hashSHA256)) | ||||
| 		hrefMatcher := regexp.MustCompile(fmt.Sprintf(`%s/files/%s/%s/test\..+#sha256-%s`, root, regexp.QuoteMeta(packageName), regexp.QuoteMeta(packageVersion), hashSHA256)) | ||||
|  | ||||
| 		for _, a := range nodes { | ||||
| 			for _, att := range a.Attr { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user