mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
plugin/file: allow README.md testing (#3052)
* Fix corefile usage * plugin/file: allow README.md testing Allow readme testing for the file plugin and fix bugs that where found: * the reader wasn't reset when re-reading the same io.reader for a different origin. Signed-off-by: Miek Gieben <miek@miek.nl> * Update test/example_test.go Co-Authored-By: Michael Grosser <development@stp-ip.net>
This commit is contained in:
@@ -87,6 +87,7 @@ func fileParse(c *caddy.Controller) (Zones, error) {
|
||||
origins[i] = plugin.Host(origins[i]).Normalize()
|
||||
z[origins[i]] = NewZone(origins[i], fileName)
|
||||
if openErr == nil {
|
||||
reader.Seek(0, 0)
|
||||
zone, err := Parse(reader, origins[i], fileName, 0)
|
||||
if err == nil {
|
||||
z[origins[i]] = zone
|
||||
|
||||
Reference in New Issue
Block a user