caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
55.45k stars 3.91k forks source link

replacer: `{file.*}` global placeholder strips trailing newline #6411

Open steffenbusch opened 1 week ago

steffenbusch commented 1 week ago

Fixes https://github.com/caddyserver/caddy/issues/6392

francislavoie commented 1 week ago

What the heck, test failed on Windows for some reason :thinking:

    replacer_test.go:445: Expected value 'foo' for key 'file.caddytest/integration/testdata/foo_with_trailing_newline.txt' got 'foo
'
    replacer_test.go:445: Expected value 'foo
        ' for key 'file.caddytest/integration/testdata/foo_with_multiple_trailing_newlines.txt' got 'foo

'
--- FAIL: TestReplacerNew (0.01s)
francislavoie commented 1 week ago

Oh, Windows might have \r\n instead. That's annoying.