summaryrefslogtreecommitdiff
path: root/tests/plugins/static
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-23 17:54:58 +0300
committerValery Piashchynski <[email protected]>2021-01-23 17:54:58 +0300
commit01a6fab935fc2e40d7b6c17ab75a20a74ca23d1d (patch)
tree59967433eb8220e60020011873623a7454941314 /tests/plugins/static
parent29d6020a9e8a3713b22269ed946547c96c24d3da (diff)
Stabilization PR
Diffstat (limited to 'tests/plugins/static')
-rw-r--r--tests/plugins/static/configs/.rr-http-static-disabled.yaml7
-rw-r--r--tests/plugins/static/configs/.rr-http-static-files-disable.yaml6
-rw-r--r--tests/plugins/static/static_plugin_test.go7
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/plugins/static/configs/.rr-http-static-disabled.yaml b/tests/plugins/static/configs/.rr-http-static-disabled.yaml
index e31baffc..9f04b8a9 100644
--- a/tests/plugins/static/configs/.rr-http-static-disabled.yaml
+++ b/tests/plugins/static/configs/.rr-http-static-disabled.yaml
@@ -11,7 +11,7 @@ http:
debug: true
address: 127.0.0.1:21234
max_request_size: 1024
- middleware: [ "gzip", "static" ]
+ middleware: [ "gzip" ]
trusted_subnets: [ "10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "::1/128", "fc00::/7", "fe80::/10" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
@@ -19,10 +19,9 @@ http:
dir: "abc" #not exists
forbid: [ ".php", ".htaccess" ]
request:
- "Example-Request-Header": "Value"
- # Automatically add headers to every response.
+ Example-Request-Header: "Value"
response:
- "X-Powered-By": "RoadRunner"
+ X-Powered-By: "RoadRunner"
pool:
num_workers: 2
max_jobs: 0
diff --git a/tests/plugins/static/configs/.rr-http-static-files-disable.yaml b/tests/plugins/static/configs/.rr-http-static-files-disable.yaml
index deb408db..3d4d50b9 100644
--- a/tests/plugins/static/configs/.rr-http-static-files-disable.yaml
+++ b/tests/plugins/static/configs/.rr-http-static-files-disable.yaml
@@ -11,7 +11,7 @@ http:
debug: true
address: 127.0.0.1:45877
max_request_size: 1024
- middleware: [ "gzip", "static" ]
+ middleware: [ "gzip" ]
trusted_subnets: [ "10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "::1/128", "fc00::/7", "fe80::/10" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
@@ -19,10 +19,10 @@ http:
dir: "../../../tests"
forbid: [ ".php" ]
request:
- "Example-Request-Header": "Value"
+ Example-Request-Header: "Value"
# Automatically add headers to every response.
response:
- "X-Powered-By": "RoadRunner"
+ X-Powered-By: "RoadRunner"
pool:
num_workers: 2
max_jobs: 0
diff --git a/tests/plugins/static/static_plugin_test.go b/tests/plugins/static/static_plugin_test.go
index 49721e44..d43ef765 100644
--- a/tests/plugins/static/static_plugin_test.go
+++ b/tests/plugins/static/static_plugin_test.go
@@ -13,7 +13,7 @@ import (
"time"
"github.com/golang/mock/gomock"
- "github.com/spiral/endure"
+ endure "github.com/spiral/endure/pkg/container"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/gzip"
httpPlugin "github.com/spiral/roadrunner/v2/plugins/http"
@@ -209,8 +209,9 @@ func TestStaticDisabled(t *testing.T) {
func staticDisabled(t *testing.T) {
_, r, err := get("http://localhost:21234/sample.txt") //nolint:bodyclose
- assert.Error(t, err)
- assert.Nil(t, r)
+ assert.NoError(t, err)
+ assert.NotNil(t, r)
+ assert.Empty(t, r.Header.Get("X-Powered-By"))
}
func TestStaticFilesDisabled(t *testing.T) {