Monorepo for Tangled tangled.org
757
fork

Configure Feed

Select the types of activity you want to include in your feed.

knotmirror: add scheme to proxy hosts

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by
Seongmin Lee
7b74e173 d41fb1ea

+14 -1
+14 -1
knotmirror/xrpc/proxy.go
··· 54 54 } 55 55 }() 56 56 } 57 - return &knotInfo{baseURL: repo.KnotDomain, didSlashRepo: repo.DidSlashRepo()}, nil 57 + knotURL := repo.KnotDomain 58 + if !strings.Contains(repo.KnotDomain, "://") { 59 + if host, _ := db.GetHost(ctx, x.db, repo.KnotDomain); host != nil { 60 + knotURL = host.URL() 61 + } else { 62 + x.logger.Warn("repo is from unknown knot") 63 + if x.cfg.KnotUseSSL { 64 + knotURL = "https://" + knotURL 65 + } else { 66 + knotURL = "http://" + knotURL 67 + } 68 + } 69 + } 70 + return &knotInfo{baseURL: knotURL, didSlashRepo: repo.DidSlashRepo()}, nil 58 71 } 59 72 60 73 owner, err := x.resolver.ResolveIdent(ctx, repoAt.Authority().String())