···
"github.com/bluesky-social/indigo/atproto/identity"
"github.com/go-chi/chi/v5"
func (s *State) InfoRefs(w http.ResponseWriter, r *http.Request) {
user := r.Context().Value("resolvedId").(identity.Identity)
-
knot := r.Context().Value("knot").(string)
-
repo := chi.URLParam(r, "repo")
-
targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
s.proxyRequest(w, r, targetURL)
···
http.Error(w, "failed to resolve user", http.StatusInternalServerError)
-
knot := r.Context().Value("knot").(string)
-
repo := chi.URLParam(r, "repo")
-
targetURL := fmt.Sprintf("%s://%s/%s/%s/git-upload-pack?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
s.proxyRequest(w, r, targetURL)
···
http.Error(w, "failed to resolve user", http.StatusInternalServerError)
-
knot := r.Context().Value("knot").(string)
-
repo := chi.URLParam(r, "repo")
-
targetURL := fmt.Sprintf("%s://%s/%s/%s/git-receive-pack?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
s.proxyRequest(w, r, targetURL)
···
-
for k, v := range resp.Header {
// Set response status code
w.WriteHeader(resp.StatusCode)
···
"github.com/bluesky-social/indigo/atproto/identity"
"github.com/go-chi/chi/v5"
+
"tangled.sh/tangled.sh/core/appview/db"
func (s *State) InfoRefs(w http.ResponseWriter, r *http.Request) {
user := r.Context().Value("resolvedId").(identity.Identity)
+
repo := r.Context().Value("repo").(*db.Repo)
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", scheme, repo.Knot, user.DID, repo.Name, r.URL.RawQuery)
s.proxyRequest(w, r, targetURL)
···
http.Error(w, "failed to resolve user", http.StatusInternalServerError)
+
repo := r.Context().Value("repo").(*db.Repo)
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/git-upload-pack?%s", scheme, repo.Knot, user.DID, repo.Name, r.URL.RawQuery)
s.proxyRequest(w, r, targetURL)
···
http.Error(w, "failed to resolve user", http.StatusInternalServerError)
+
repo := r.Context().Value("repo").(*db.Repo)
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/git-receive-pack?%s", scheme, repo.Knot, user.DID, repo.Name, r.URL.RawQuery)
s.proxyRequest(w, r, targetURL)
···
+
maps.Copy(w.Header(), resp.Header)
// Set response status code
w.WriteHeader(resp.StatusCode)