-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed1b30a
commit b7423ca
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package interstitialUi | ||
|
||
import "embed" | ||
|
||
//go:embed index.html | ||
var FS embed.FS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package interstitialUi | ||
|
||
import ( | ||
"github.com/sirupsen/logrus" | ||
"net/http" | ||
) | ||
|
||
func WriteInterstitialAnnounce(w http.ResponseWriter) { | ||
if data, err := FS.ReadFile("index.html"); err == nil { | ||
w.WriteHeader(http.StatusOK) | ||
n, err := w.Write(data) | ||
if n != len(data) { | ||
logrus.Errorf("short write") | ||
return | ||
} | ||
if err != nil { | ||
logrus.Error(err) | ||
return | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<script> | ||
function onClick() { | ||
document.cookie = "zrok_interstitial = true"; | ||
window.location.reload(); | ||
} | ||
</script> | ||
<body> | ||
<h1>this is a zrok share!</h1> | ||
<button onClick="onClick()">Visit Site</button> | ||
</body> | ||
</html> |