From ee2e495a76c1cb0666f6f210ed0e59f94314b9e5 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 10 Jun 2018 15:25:20 +0300 Subject: tests --- _____/http/config.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to '_____/http/config.go') diff --git a/_____/http/config.go b/_____/http/config.go index 4ea414c1..bd8cec5e 100644 --- a/_____/http/config.go +++ b/_____/http/config.go @@ -7,6 +7,7 @@ import ( "os" "path" "strings" + "github.com/spiral/roadrunner/http" ) // Configures RoadRunner HTTP server. @@ -14,21 +15,23 @@ type Config struct { // serve enables static file serving from desired root directory. ServeStatic bool + Static *http.FsConfig + // Root directory, required when serve set to true. Root string - // TmpDir contains name of temporary directory to store uploaded files passed to underlying PHP process. + // Dir contains name of temporary directory to store uploaded files passed to underlying PHP process. TmpDir string // MaxRequest specified max size for payload body in bytes, set 0 to unlimited. MaxRequest int64 - // ForbidUploads specifies list of file extensions which are forbidden for uploads. + // Forbid specifies list of file extensions which are forbidden for uploads. // Example: .php, .exe, .bat, .htaccess and etc. ForbidUploads []string } -// ForbidUploads must return true if file extension is not allowed for the upload. +// Forbid must return true if file extension is not allowed for the upload. func (cfg Config) Forbidden(filename string) bool { ext := strings.ToLower(path.Ext(filename)) @@ -46,7 +49,7 @@ type serviceConfig struct { Host string Port string MaxRequest string - Static struct { + Static struct { Serve bool Root string } -- cgit v1.2.3