forked from wallabag/wallabag
Define a custom user-agent for wallabag
This commit is contained in:
@ -14,6 +14,7 @@ class LoginFormAuthenticator
|
||||
public function __construct(
|
||||
private readonly HttpBrowser $browser,
|
||||
AuthenticatorProvider $authenticatorProvider,
|
||||
private readonly string $defaultUserAgent,
|
||||
) {
|
||||
$this->expressionLanguage = new ExpressionLanguage(null, [$authenticatorProvider]);
|
||||
}
|
||||
@ -84,6 +85,10 @@ class LoginFormAuthenticator
|
||||
$headers["HTTP_$headerName"] = $headerValue;
|
||||
}
|
||||
|
||||
if (empty($headers['HTTP_user-agent'])) {
|
||||
$headers['HTTP_user-agent'] = $this->defaultUserAgent;
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user