gatherstats: Don't' overwrite User-Agent with X-Newsreader.

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2026-01-17 03:01:54 +01:00
parent deb812da58
commit f3b184f2e3
2 changed files with 4 additions and 3 deletions

View file

@ -411,8 +411,8 @@ sub ClientStats {
# parse header # parse header
# User-Agent style # User-Agent style
if ($Header{'x-newsreader'} =~ /^([^\/ ]+\/[^\/ ]+ ?)+$/) { if ($Header{'x-newsreader'} =~ /^([^\/ ]+\/[^\/ ]+ ?)+$/) {
# transfer to user-agent and parse from there # transfer to user-agent, if not set, and parse from there
$Header{'user-agent'} = $Header{'x-newsreader'}; $Header{'user-agent'} = $Header{'x-newsreader'} if !$Header{'user-agent'};
# "client name version" # "client name version"
} elsif ($Header{'x-newsreader'} =~ / /) { } elsif ($Header{'x-newsreader'} =~ / /) {
($Client, $Version) = ParseXNewsreader($Header{'x-newsreader'}); ($Client, $Version) = ParseXNewsreader($Header{'x-newsreader'});
@ -428,7 +428,7 @@ sub ClientStats {
version => $Version); version => $Version);
push @Clients, { %UserAgent }; push @Clients, { %UserAgent };
} else { } else {
$Header{'user-agent'} = $Header{'x-newsreader'}; $Header{'user-agent'} = $Header{'x-newsreader'} if !$Header{'user-agent'};
} }
} }
### User-Agent ### User-Agent

View file

@ -6,6 +6,7 @@ NewsStats 0.5.0 (unreleased)
* Rename postingstats.pl to poststats.pl, rename * Rename postingstats.pl to poststats.pl, rename
dopostingstats.sh accordingly, fix all references. dopostingstats.sh accordingly, fix all references.
* Fix missing variable initialisation in FormatOutput(). * Fix missing variable initialisation in FormatOutput().
* gatherstats: Don't' overwrite User-Agent with X-Newsreader.
NewsStats 0.4.0 (2025-06-02) NewsStats 0.4.0 (2025-06-02)
* Reformat $Conf{TLH} for GroupStats only. * Reformat $Conf{TLH} for GroupStats only.