caddy icon indicating copy to clipboard operation
caddy copied to clipboard

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

Open steffenbusch opened this issue 1 year ago • 2 comments

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

steffenbusch avatar Jun 19 '24 15:06 steffenbusch

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 avatar Jun 19 '24 16:06 francislavoie

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

francislavoie avatar Jun 19 '24 16:06 francislavoie

Sounds good to me now. To clarify, is the consensus that this is ready to merge?

mholt avatar Jul 15 '24 17:07 mholt

Sounds good to me now. To clarify, is the consensus that this is ready to merge?

@francislavoie & @mohammed90 could you please provide feedback to @mholt on whether there is a consensus that this Pull Request is ready to merge? Thanks!

steffenbusch avatar Aug 07 '24 19:08 steffenbusch