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:
authorJaime Martinez <jmartinez@gitlab.com>2021-02-08 06:44:45 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-02-08 06:53:52 +0300
commit937ce0e789a5c372f17ec6590a64006e26fb986b (patch)
treeb23c65ecacf003664c7f5091b67ce0ce81a1b86b
parentde481bad5878862ae6f693190c3aa3d85242b2c9 (diff)
Add test for file outside allowedPaths
(cherry picked from commit b519027459919125c5227fcb60519bdd18b4c780)
-rw-r--r--internal/serving/disk/zip/serving_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/serving/disk/zip/serving_test.go b/internal/serving/disk/zip/serving_test.go
index bfa9e155..249dae1f 100644
--- a/internal/serving/disk/zip/serving_test.go
+++ b/internal/serving/disk/zip/serving_test.go
@@ -78,6 +78,11 @@ func TestZip_ServeFileHTTP(t *testing.T) {
path: "/index.html",
expectedStatus: http.StatusInternalServerError,
},
+ "accessing file:// outside of allowedPaths": {
+ vfsPath: "file:///some/file/outside/path",
+ path: "/index.html",
+ expectedStatus: http.StatusInternalServerError,
+ },
}
cfg := &config.Config{