From 5cd119ba585ad5c4c917615c0851fadab866edcc Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 18 Feb 2026 11:19:55 -0800 Subject: [PATCH] Limit license name's size --- modules/structs/repo.go | 2 +- services/forms/repo_form.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 765546a5aa..8146166465 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -143,7 +143,7 @@ type CreateRepoOption struct { // Gitignores to use Gitignores string `json:"gitignores"` // License to use - License string `json:"license"` + License string `json:"license" binding:"MaxSize(100)"` // Readme of the repository to create Readme string `json:"readme"` // DefaultBranch of the repository (used when initializes and in template) diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index 765a723968..956329f480 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -28,7 +28,7 @@ type CreateRepoForm struct { AutoInit bool Gitignores string IssueLabels string - License string + License string `binding:"MaxSize(100)"` Readme string Template bool