tangled
alpha
login
or
join now
bad-example.com
/
core
forked from
tangled.org/core
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
appview: use https if s.config.Dev isn't set
anirudh.fi
10 months ago
4e59a839
81420b7b
+35
-8
1 changed file
expand all
collapse all
unified
split
appview
state
repo.go
+35
-8
appview/state/repo.go
···
35
35
log.Println("failed to fully resolve repo", err)
36
36
return
37
37
}
38
38
+
protocol := "http"
39
39
+
if !s.config.Dev {
40
40
+
protocol = "https"
41
41
+
}
42
42
+
38
43
var reqUrl string
39
44
if ref != "" {
40
40
-
reqUrl = fmt.Sprintf("http://%s/%s/%s/tree/%s", f.Knot, f.OwnerDid(), f.RepoName, ref)
45
45
+
reqUrl = fmt.Sprintf("%s://%s/%s/%s/tree/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref)
41
46
} else {
42
42
-
reqUrl = fmt.Sprintf("http://%s/%s/%s", f.Knot, f.OwnerDid(), f.RepoName)
47
47
+
reqUrl = fmt.Sprintf("%s://%s/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName)
43
48
}
44
49
45
50
resp, err := http.Get(reqUrl)
···
101
106
}
102
107
103
108
ref := chi.URLParam(r, "ref")
104
104
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/log/%s?page=%d&per_page=30", f.Knot, f.OwnerDid(), f.RepoName, ref, page))
109
109
+
110
110
+
protocol := "http"
111
111
+
if !s.config.Dev {
112
112
+
protocol = "https"
113
113
+
}
114
114
+
115
115
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/log/%s?page=%d&per_page=30", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, page))
105
116
if err != nil {
106
117
log.Println("failed to reach knotserver", err)
107
118
return
···
229
240
log.Println("failed to fully resolve repo", err)
230
241
return
231
242
}
232
232
-
233
243
ref := chi.URLParam(r, "ref")
234
234
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/commit/%s", f.Knot, f.OwnerDid(), f.RepoName, ref))
244
244
+
protocol := "http"
245
245
+
if !s.config.Dev {
246
246
+
protocol = "https"
247
247
+
}
248
248
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/commit/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref))
235
249
if err != nil {
236
250
log.Println("failed to reach knotserver", err)
237
251
return
···
268
282
269
283
ref := chi.URLParam(r, "ref")
270
284
treePath := chi.URLParam(r, "*")
271
271
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/tree/%s/%s", f.Knot, f.OwnerDid(), f.RepoName, ref, treePath))
285
285
+
protocol := "http"
286
286
+
if !s.config.Dev {
287
287
+
protocol = "https"
288
288
+
}
289
289
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/tree/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, treePath))
272
290
if err != nil {
273
291
log.Println("failed to reach knotserver", err)
274
292
return
···
318
336
return
319
337
}
320
338
321
321
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/tags", f.Knot, f.OwnerDid(), f.RepoName))
339
339
+
protocol := "http"
340
340
+
if !s.config.Dev {
341
341
+
protocol = "https"
342
342
+
}
343
343
+
344
344
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/tags", protocol, f.Knot, f.OwnerDid(), f.RepoName))
322
345
if err != nil {
323
346
log.Println("failed to reach knotserver", err)
324
347
return
···
390
413
391
414
ref := chi.URLParam(r, "ref")
392
415
filePath := chi.URLParam(r, "*")
393
393
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/blob/%s/%s", f.Knot, f.OwnerDid(), f.RepoName, ref, filePath))
416
416
+
protocol := "http"
417
417
+
if !s.config.Dev {
418
418
+
protocol = "https"
419
419
+
}
420
420
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/blob/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, filePath))
394
421
if err != nil {
395
422
log.Println("failed to reach knotserver", err)
396
423
return