diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-08 06:44:45 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-08 06:53:52 +0300 |
commit | 937ce0e789a5c372f17ec6590a64006e26fb986b (patch) | |
tree | b23c65ecacf003664c7f5091b67ce0ce81a1b86b | |
parent | de481bad5878862ae6f693190c3aa3d85242b2c9 (diff) |
Add test for file outside allowedPaths
(cherry picked from commit b519027459919125c5227fcb60519bdd18b4c780)
-rw-r--r-- | internal/serving/disk/zip/serving_test.go | 5 |
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{ |