mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 22:23:48 +03:00
Minor tweaks
This commit is contained in:
parent
f217181293
commit
bdf92ee84e
3 changed files with 6 additions and 6 deletions
7
caddy.go
7
caddy.go
|
@ -208,8 +208,8 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
|
||||||
// If no version information is available, a non-nil
|
// If no version information is available, a non-nil
|
||||||
// value will still be returned, but with an
|
// value will still be returned, but with an
|
||||||
// unknown version.
|
// unknown version.
|
||||||
func GoModule() *debug.Module {
|
func GoModule() debug.Module {
|
||||||
mod := &debug.Module{Version: "unknown"}
|
mod := debug.Module{Version: "unknown"}
|
||||||
bi, ok := debug.ReadBuildInfo()
|
bi, ok := debug.ReadBuildInfo()
|
||||||
if ok {
|
if ok {
|
||||||
mod.Path = bi.Main.Path
|
mod.Path = bi.Main.Path
|
||||||
|
@ -219,9 +219,10 @@ func GoModule() *debug.Module {
|
||||||
// once that issue is fixed, we should just be able to use bi.Main... hopefully.
|
// once that issue is fixed, we should just be able to use bi.Main... hopefully.
|
||||||
for _, dep := range bi.Deps {
|
for _, dep := range bi.Deps {
|
||||||
if dep.Path == mod.Path {
|
if dep.Path == mod.Path {
|
||||||
return dep
|
return *dep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return bi.Main
|
||||||
}
|
}
|
||||||
return mod
|
return mod
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ func init() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zstd can create zstd encoders.
|
// Zstd can create Zstandard encoders.
|
||||||
type Zstd struct{}
|
type Zstd struct{}
|
||||||
|
|
||||||
// AcceptEncoding returns the name of the encoding as
|
// AcceptEncoding returns the name of the encoding as
|
||||||
|
|
|
@ -76,9 +76,8 @@ func (m MatchFile) Match(r *http.Request) bool {
|
||||||
if matched {
|
if matched {
|
||||||
repl.Set("http.matchers.file.relative", rel)
|
repl.Set("http.matchers.file.relative", rel)
|
||||||
repl.Set("http.matchers.file.absolute", abs)
|
repl.Set("http.matchers.file.absolute", abs)
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
return false
|
return matched
|
||||||
}
|
}
|
||||||
|
|
||||||
// selectFile chooses a file according to m.TryPolicy by appending
|
// selectFile chooses a file according to m.TryPolicy by appending
|
||||||
|
|
Loading…
Reference in a new issue