mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-16 17:20:34 +00:00
replacer: {file.*} global placeholder strips trailing newline (#6411)
Co-authored-by: Kanashimia <chad@redpilled.dev>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package caddy
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -354,6 +355,8 @@ func (f fileReplacementProvider) replace(key string) (any, bool) {
|
||||
zap.Error(err))
|
||||
return nil, true
|
||||
}
|
||||
body = bytes.TrimSuffix(body, []byte("\n"))
|
||||
body = bytes.TrimSuffix(body, []byte("\r"))
|
||||
return string(body), true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user