Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
Minor tweaks
Matthew Holt committed
Jul 15, 2019 at 17:33 UTC
bdf92ee84efa6b623698450553cb5509f1cfb66d
3 files changed
+6
-6
caddy.go
+4
-3
@@ -208,8 +208,8 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
208
// If no version information is available, a non-nil
209
// value will still be returned, but with an
210
// unknown version.
211
-func GoModule() *debug.Module {
212
- mod := &debug.Module{Version: "unknown"}
211
+func GoModule() debug.Module {
212
+ mod := debug.Module{Version: "unknown"}
213
bi, ok := debug.ReadBuildInfo()
214
if ok {
215
mod.Path = bi.Main.Path
@@ -219,9 +219,10 @@ func GoModule() *debug.Module {
219
// once that issue is fixed, we should just be able to use bi.Main... hopefully.
220
for _, dep := range bi.Deps {
221
if dep.Path == mod.Path {
222
- return dep
222
+ return *dep
223
}
224
}
225
+ return bi.Main
226
}
227
return mod
228
}
modules/caddyhttp/encode/zstd/zstd.go
+1
-1
@@ -27,7 +27,7 @@ func init() {
27
})
28
}
29
30
-// Zstd can create zstd encoders.
30
+// Zstd can create Zstandard encoders.
31
type Zstd struct{}
32
33
// AcceptEncoding returns the name of the encoding as
modules/caddyhttp/fileserver/matcher.go
+1
-2
@@ -76,9 +76,8 @@ func (m MatchFile) Match(r *http.Request) bool {
76
if matched {
77
repl.Set("http.matchers.file.relative", rel)
78
repl.Set("http.matchers.file.absolute", abs)
79
- return true
79
}
81
- return false
80
+ return matched
81
}
82
83
// selectFile chooses a file according to m.TryPolicy by appending