+8
-1
src/pages.go
+8
-1
src/pages.go
···
820
// any intentional deviation is an opportunity to miss an issue that will affect our
821
// visitors but not our health checks.
822
if r.Header.Get("Health-Check") == "" {
823
-
logc.Println(r.Context(), "pages:", r.Method, r.Host, r.URL, r.Header.Get("Content-Type"))
824
if region := os.Getenv("FLY_REGION"); region != "" {
825
machine_id := os.Getenv("FLY_MACHINE_ID")
826
w.Header().Add("Server", fmt.Sprintf("git-pages (fly.io; %s; %s)", region, machine_id))
···
820
// any intentional deviation is an opportunity to miss an issue that will affect our
821
// visitors but not our health checks.
822
if r.Header.Get("Health-Check") == "" {
823
+
var mediaType string
824
+
switch r.Method {
825
+
case "HEAD", "GET":
826
+
mediaType = r.Header.Get("Accept")
827
+
default:
828
+
mediaType = r.Header.Get("Content-Type")
829
+
}
830
+
logc.Println(r.Context(), "pages:", r.Method, r.Host, r.URL, mediaType)
831
if region := os.Getenv("FLY_REGION"); region != "" {
832
machine_id := os.Getenv("FLY_MACHINE_ID")
833
w.Header().Add("Server", fmt.Sprintf("git-pages (fly.io; %s; %s)", region, machine_id))