Signed-off-by: Anirudh Oppiliappan anirudh@tangled.sh
+11
-3
knotserver/routes.go
+11
-3
knotserver/routes.go
···+writeError(w, "only image, video, and text files can be accessed directly", http.StatusForbidden)
+2
-2
appview/pages/markup/camo.go
+2
-2
appview/pages/markup/camo.go
······
+4
appview/pages/pages.go
+4
appview/pages/pages.go
+19
-6
appview/pages/templates/repo/blob.html
+19
-6
appview/pages/templates/repo/blob.html
······+<video controls class="max-w-full h-auto mx-auto border border-gray-200 dark:border-gray-700 rounded">
+52
-13
appview/repo/repo.go
+52
-13
appview/repo/repo.go
······+blobURL := fmt.Sprintf("%s://%s/%s/%s/raw/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, filePath)+contentSrc = markup.GenerateCamoURL(rp.config.Camo.Host, rp.config.Camo.SharedSecret, blobURL)·········-resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/blob/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, filePath))+blobURL := fmt.Sprintf("%s://%s/%s/%s/raw/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, filePath)+} else if strings.HasPrefix(contentType, "image/") || strings.HasPrefix(contentType, "video/") {