summaryrefslogtreecommitdiffstats
path: root/services/migrations
diff options
context:
space:
mode:
authorMichael Kriese <michael.kriese@visualon.de>2024-11-03 14:47:05 +0100
committerMichael Kriese <michael.kriese@visualon.de>2024-11-03 16:08:58 +0100
commit284ffe4e00e822db50bf22269da80f8dc39fe669 (patch)
tree552939fda864f5df29a2853f9c0e669bec16245b /services/migrations
parentMerge pull request 'chore(cleanup): remove unused TestCreateFile' (#5788) fro... (diff)
downloadforgejo-284ffe4e00e822db50bf22269da80f8dc39fe669.tar.xz
forgejo-284ffe4e00e822db50bf22269da80f8dc39fe669.zip
fix: support `www.github.com` for migrations
Diffstat (limited to 'services/migrations')
-rw-r--r--services/migrations/github.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/migrations/github.go b/services/migrations/github.go
index 3b127438d0..ca7aaeb68f 100644
--- a/services/migrations/github.go
+++ b/services/migrations/github.go
@@ -45,6 +45,11 @@ func (f *GithubDownloaderV3Factory) New(ctx context.Context, opts base.MigrateOp
return nil, err
}
+ // some users are using the github redirect url for migration
+ if u.Host == "www.github.com" {
+ u.Host = "github.com"
+ }
+
baseURL := u.Scheme + "://" + u.Host
fields := strings.Split(u.Path, "/")
oldOwner := fields[1]