Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func fileExists(p string) bool {
// redirectToHelia sends `302 /?helia-sw=<escaped original URI>`
func redirectToHelia(w http.ResponseWriter, r *http.Request) {
target := "/?helia-sw=" + url.QueryEscape(r.URL.RequestURI())
// if referer is ipfs-sw-content-viewer.html, then we should not redirect
if r.Referer() == "ipfs-sw-content-viewer.html" {
return
}
http.Redirect(w, r, target, http.StatusFound)
}

Expand Down
Loading
Loading