summaryrefslogtreecommitdiffhomepage
path: root/caddy.go
diff options
context:
space:
mode:
authorMike Pulaski <[email protected]>2016-09-05 18:34:32 +0200
committerMike Pulaski <[email protected]>2016-09-05 18:34:32 +0200
commit635714fe383af210f8aa09ba5f1d9aa2bfb69a62 (patch)
tree4f64c2201da4704e94cf62b9070b96865e0937a0 /caddy.go
parenta12230419611951692ee0bb5cd407e6e884be2c2 (diff)
downloadcaddy-635714fe383af210f8aa09ba5f1d9aa2bfb69a62.tar.gz
caddy-635714fe383af210f8aa09ba5f1d9aa2bfb69a62.zip
Caddyfiles read from STDIN now have server types associated with them. Fixes #1090.
Diffstat (limited to 'caddy.go')
-rw-r--r--caddy.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/caddy.go b/caddy.go
index 76ebc0134..415c59cff 100644
--- a/caddy.go
+++ b/caddy.go
@@ -388,7 +388,7 @@ func (i *Instance) Wait() {
// but the Input value will be nil. An error is only returned
// if there was an error reading the pipe, even if the length
// of what was read is 0.
-func CaddyfileFromPipe(f *os.File) (Input, error) {
+func CaddyfileFromPipe(f *os.File, serverType string) (Input, error) {
fi, err := f.Stat()
if err == nil && fi.Mode()&os.ModeCharDevice == 0 {
// Note that a non-nil error is not a problem. Windows
@@ -402,8 +402,9 @@ func CaddyfileFromPipe(f *os.File) (Input, error) {
return nil, err
}
return CaddyfileInput{
- Contents: confBody,
- Filepath: f.Name(),
+ Contents: confBody,
+ Filepath: f.Name(),
+ ServerTypeName: serverType,
}, nil
}