1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-31 02:29:18 +02:00

Only use last X-Forwarded-For address as visitor address, closes

This commit is contained in:
Philipp Heckel 2022-06-16 15:31:09 -04:00
parent 1fae61e78f
commit 9918f4965d
5 changed files with 53 additions and 2 deletions

View file

@ -157,3 +157,8 @@ func TestSplitKV(t *testing.T) {
require.Equal(t, "mykey", key)
require.Equal(t, "value=with=separator", value)
}
func TestLastString(t *testing.T) {
require.Equal(t, "last", LastString([]string{"first", "second", "last"}, "default"))
require.Equal(t, "default", LastString([]string{}, "default"))
}