mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-17 09:26:04 +00:00
Expose metadata when running on bunny.net magic containers.
This commit is contained in:
@@ -27,6 +27,15 @@ func getPage(w http.ResponseWriter, r *http.Request) error {
|
||||
|
||||
host := GetHost(r)
|
||||
|
||||
if _, onBunnyNet := os.LookupEnv("BUNNYNET_MC_APPID"); onBunnyNet {
|
||||
w.Header().Set("X-Bunnynet-MC", fmt.Sprintf(
|
||||
"%s, %s, %s",
|
||||
os.Getenv("BUNNYNET_MC_REGION"),
|
||||
os.Getenv("BUNNYNET_MC_ZONE"),
|
||||
os.Getenv("BUNNYNET_MC_PODID"),
|
||||
))
|
||||
}
|
||||
|
||||
// allow JavaScript code to access responses (including errors) even across origins
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Max-Age", "86400")
|
||||
|
||||
Reference in New Issue
Block a user