Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.tool-versions2
-rw-r--r--README.md2
-rw-r--r--internal/feature/feature.go6
-rw-r--r--internal/serving/disk/reader.go7
-rw-r--r--test/acceptance/zip_test.go7
5 files changed, 3 insertions, 21 deletions
diff --git a/.tool-versions b/.tool-versions
index febe02eb..bf23029f 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1 +1 @@
-golang 1.16.10
+golang 1.16.12
diff --git a/README.md b/README.md
index 7cc142c5..f9385073 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[![coverage report](https://gitlab.com/gitlab-org/gitlab-pages/badges/master/coverage.svg)](https://gitlab.com/gitlab-org/gitlab-pages/commits/master)
This is a simple HTTP server written in Go, made to serve GitLab Pages with
-CNAMEs and SNI using HTTP/HTTP2. The minimum supported Go version is v1.16.
+CNAMEs and SNI using HTTP/HTTP2. The minimum supported Go version is v1.16.12.
### How it generates routes
diff --git a/internal/feature/feature.go b/internal/feature/feature.go
index d78a20d5..81eef9a0 100644
--- a/internal/feature/feature.go
+++ b/internal/feature/feature.go
@@ -25,12 +25,6 @@ var RedirectsPlaceholders = Feature{
EnvVariable: "FF_ENABLE_PLACEHOLDERS",
}
-// HandleCacheHeaders enables handling cache headers when serving from compressed ZIP archives
-// TODO: enable and remove https://gitlab.com/gitlab-org/gitlab-pages/-/issues/672
-var HandleCacheHeaders = Feature{
- EnvVariable: "FF_HANDLE_CACHE_HEADERS",
-}
-
// Enabled reads the environment variable responsible for the feature flag
// if FF is disabled by default, the environment variable needs to be "true" to explicitly enable it
// if FF is enabled by default, variable needs to be "false" to explicitly disable it
diff --git a/internal/serving/disk/reader.go b/internal/serving/disk/reader.go
index b83425eb..5961d843 100644
--- a/internal/serving/disk/reader.go
+++ b/internal/serving/disk/reader.go
@@ -14,7 +14,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
"gitlab.com/gitlab-org/labkit/errortracking"
- "gitlab.com/gitlab-org/gitlab-pages/internal/feature"
"gitlab.com/gitlab-org/gitlab-pages/internal/httperrors"
"gitlab.com/gitlab-org/gitlab-pages/internal/logging"
"gitlab.com/gitlab-org/gitlab-pages/internal/redirects"
@@ -235,11 +234,7 @@ func (reader *Reader) serveFile(ctx context.Context, w http.ResponseWriter, r *h
http.ServeContent(w, r, origPath, fi.ModTime(), rs)
} else {
w.Header().Set("Content-Length", strconv.FormatInt(fi.Size(), 10))
- if feature.HandleCacheHeaders.Enabled() {
- vfsServing.ServeCompressedFile(w, r, fi.ModTime(), file)
- } else {
- io.Copy(w, file)
- }
+ vfsServing.ServeCompressedFile(w, r, fi.ModTime(), file)
}
return true
diff --git a/test/acceptance/zip_test.go b/test/acceptance/zip_test.go
index 42734d14..dcb831e7 100644
--- a/test/acceptance/zip_test.go
+++ b/test/acceptance/zip_test.go
@@ -10,14 +10,9 @@ import (
"time"
"github.com/stretchr/testify/require"
-
- "gitlab.com/gitlab-org/gitlab-pages/internal/feature"
- "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers"
)
func TestZipServing(t *testing.T) {
- testhelpers.StubFeatureFlagValue(t, feature.HandleCacheHeaders.EnvVariable, true)
-
runObjectStorage(t, "../../shared/pages/group/zip.gitlab.io/public.zip")
RunPagesProcess(t,
@@ -243,8 +238,6 @@ func TestZipServingCache(t *testing.T) {
}
func TestZipServingFromDisk(t *testing.T) {
- testhelpers.StubFeatureFlagValue(t, feature.HandleCacheHeaders.EnvVariable, true)
-
RunPagesProcess(t,
withListeners([]ListenSpec{httpListener}),
)