Add overrides option to set User-Agent header.

This commit is contained in:
Retro_Guy 2024-04-29 08:05:41 -07:00
parent c7f51fdb57
commit 6f62f72a1b
2 changed files with 11 additions and 1 deletions

View File

@ -532,7 +532,13 @@ function message_post($subject, $from, $newsgroups, $ref, $body, $encryptthis =
fputs($ns, "Content-Type: text/plain; charset=" . $www_charset . "; format=flowed\r\n");
fputs($ns, "Content-Transfer-Encoding: 8bit\r\n");
}
fputs($ns, "User-Agent: Rocksolid Light\r\n");
if (isset($OVERRIDES['user_agent'])) {
if ($OVERRIDES['user_agent'] != '') {
fputs($ns, "User-Agent: " . $OVERRIDES['user_agent'] . "\r\n");
}
} else {
fputs($ns, "User-Agent: Rocksolid Light\r\n");
}
if ($send_poster_host)
@fputs($ns, 'X-HTTP-Posting-Host: ' . gethostbyaddr(getenv("REMOTE_ADDR")) . "\r\n");
if (($ref != false) && (count($ref) > 0)) {

View File

@ -58,6 +58,10 @@ return [
// If unset, default is 'articles'
'overboard_default_view' => 'articles',
// Set User-Agent: string (default = 'Rocksolid Light')
// Set to '' for no User-Agent: header
'user_agent' => 'Rocksolid Light',
// Just leave this here to avoid comma errors
'comma' => true
];