diff options
Diffstat (limited to 'internal/postgres/insert_module.go')
| -rw-r--r-- | internal/postgres/insert_module.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go index 512c803b..f292feb8 100644 --- a/internal/postgres/insert_module.go +++ b/internal/postgres/insert_module.go @@ -25,6 +25,7 @@ import ( "golang.org/x/pkgsite/internal" "golang.org/x/pkgsite/internal/database" "golang.org/x/pkgsite/internal/derrors" + "golang.org/x/pkgsite/internal/licenses" "golang.org/x/pkgsite/internal/log" "golang.org/x/pkgsite/internal/stdlib" "golang.org/x/pkgsite/internal/version" @@ -713,6 +714,11 @@ func removeNonDistributableData(m *internal.Module) { } } } + for _, l := range m.Licenses { + if !licenses.Redistributable(l.Types) { + l.Contents = nil + } + } } // DeleteModule deletes a Version from the database. |
