summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-10-28 15:08:45 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-10-28 15:08:45 -0600
commit442fd748f6ef1215fb859d8aefe6c817988d189a (patch)
tree044a1ac9cfd9c701597f13de410c8d3a9a676454 /modules
parentb00dfd3965f400956c5bb5b388e9d54ef98052e5 (diff)
caddyhttp: Minor cleanup and fix nil pointer deref in caddyfile adapter
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/caddyauth/command.go4
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go15
2 files changed, 14 insertions, 5 deletions
diff --git a/modules/caddyhttp/caddyauth/command.go b/modules/caddyhttp/caddyauth/command.go
index c110001..70a11a0 100644
--- a/modules/caddyhttp/caddyauth/command.go
+++ b/modules/caddyhttp/caddyauth/command.go
@@ -56,6 +56,10 @@ func cmdHashPassword(fs caddycmd.Flags) (int, error) {
plaintext := []byte(fs.String("plaintext"))
salt := []byte(fs.String("salt"))
+ if len(plaintext) == 0 {
+ return caddy.ExitCodeFailedStartup, fmt.Errorf("password is required")
+ }
+
var hash []byte
var err error
switch algorithm {
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go
index b7326af..ed97342 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go
@@ -82,12 +82,17 @@ func (t *Transport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
//
// is equivalent to:
//
-// matcher indexFiles {
+// matcher canonicalPath {
// file {
-// try_files {path} index.php
+// try_files {path}/index.php
+// }
+// not {
+// path */
// }
// }
-// rewrite match:indexFiles {http.matchers.file.relative}
+// redir match:canonicalPath {path}/ 308
+//
+// try_files {path} {path}/index.php index.php
//
// matcher phpFiles {
// path *.php
@@ -101,8 +106,8 @@ func (t *Transport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
// Thus, this directive produces multiple routes, each with a different
// matcher because multiple consecutive routes are necessary to support
// the common PHP use case. If this "common" config is not compatible
-// with a user's PHP requirements, they can use the manual approach as
-// above to configure it precisely as they need.
+// with a user's PHP requirements, they can use a manual approach based
+// on the example above to configure it precisely as they need.
//
// If a matcher is specified by the user, for example:
//