···375375 if !rp.config.Core.Dev {
376376 protocol = "https"
377377 }
378378+379379+ // if the tree path has a trailing slash, let's strip it
380380+ // so we don't 404
381381+ treePath = strings.TrimSuffix(treePath, "/")
382382+378383 resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/tree/%s/%s", protocol, f.Knot, f.OwnerDid(), f.Repo.Name, ref, treePath))
379384 if err != nil {
380385 log.Println("failed to reach knotserver", err)
386386+ return
387387+ }
388388+389389+ // uhhh so knotserver returns a 500 if the entry isn't found in
390390+ // the requested tree path, so let's stick to not-OK here.
391391+ // we can fix this once we build out the xrpc apis for these operations.
392392+ if resp.StatusCode != http.StatusOK {
393393+ rp.pages.Error404(w)
381394 return
382395 }
383396···525538 resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/blob/%s/%s", protocol, f.Knot, f.OwnerDid(), f.Repo.Name, ref, filePath))
526539 if err != nil {
527540 log.Println("failed to reach knotserver", err)
541541+ return
542542+ }
543543+544544+ if resp.StatusCode == http.StatusNotFound {
545545+ rp.pages.Error404(w)
528546 return
529547 }
530548