From 52bfd42d107013351bf264bb8b7d1e3001b0f714 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:27:33 -1000 Subject: Check both avatar filters through cgit Only email-gravatar ever ran inside cgit, and nothing there checked that the icon is fetched without a Referer. --- tests/t0504-email-avatar.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/t0504-email-avatar.sh b/tests/t0504-email-avatar.sh index dc00426..75dc6da 100755 --- a/tests/t0504-email-avatar.sh +++ b/tests/t0504-email-avatar.sh @@ -55,6 +55,9 @@ test_expect_success 'point cgit at it through the email filter' ' repo.url=avatar repo.path=$PWD/repos/avatar/.git repo.email-filter=lua:$EXTENSIONS_DIRECTORY/email-gravatar.lua + repo.url=libravatar + repo.path=$PWD/repos/avatar/.git + repo.email-filter=lua:$EXTENSIONS_DIRECTORY/email-libravatar.lua EOF ' @@ -63,7 +66,14 @@ test_expect_success 'point cgit at it through the email filter' ' test_expect_success CGIT_LUA_OSSL 'the commit page draws the author icon' ' cgit_ok_url "avatar/commit/" >tmp && test_grep "gravatar.com/avatar/b0eda69977c26118feff17875d53376006568bcbcde5ca0c916d01f05c281436" tmp && - test_grep "loading=.lazy." tmp + test_grep "loading=.lazy." tmp && + test_grep "referrerpolicy=.no-referrer." tmp +' + +test_expect_success CGIT_LUA_OSSL 'the libravatar filter draws it from its own service' ' + cgit_ok_url "libravatar/commit/" >tmp && + test_grep "seccdn.libravatar.org/avatar/b0eda69977c26118feff17875d53376006568bcbcde5ca0c916d01f05c281436" tmp && + test_grep "referrerpolicy=.no-referrer." tmp ' test_expect_success CGIT_LUA 'without luaossl the page keeps the name alone' ' -- cgit 2.12.1