Skip to content

Commit 70226ea

Browse files
[MAINTENANCE] Use the same default userAgent as defined in extension configuration (kitodo#1621)
Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
1 parent 1845af5 commit 70226ea

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Classes/Common/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ public static function getUrl(string $url)
865865
$configuration = [
866866
'timeout' => 30,
867867
'headers' => [
868-
'User-Agent' => $extConf['userAgent'] ?? 'Kitodo.Presentation Proxy',
868+
'User-Agent' => $extConf['userAgent'] ?? 'Kitodo.Presentation',
869869
],
870870
];
871871
try {

Classes/Eid/PageViewProxy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public function __construct()
6464
/**
6565
* Return a response that is derived from $response and contains CORS
6666
* headers to be sent to the client.
67-
*
67+
*
6868
* @access protected
6969
*
7070
* @param ResponseInterface $response
7171
* @param ServerRequestInterface $request The incoming request.
72-
*
72+
*
7373
* @return ResponseInterface
7474
*/
7575
protected function withCorsResponseHeaders(
@@ -148,7 +148,7 @@ protected function handleHead(ServerRequestInterface $request): ResponseInterfac
148148
try {
149149
$targetResponse = $this->requestFactory->request($url, 'HEAD', [
150150
'headers' => [
151-
'User-Agent' => $this->extConf['userAgent'] ?? 'Kitodo.Presentation Proxy',
151+
'User-Agent' => $this->extConf['userAgent'] ?? 'Kitodo.Presentation',
152152
]
153153
]);
154154
} catch (\Exception $e) {
@@ -193,7 +193,7 @@ protected function handleGet(ServerRequestInterface $request): ResponseInterface
193193
try {
194194
$targetResponse = $this->requestFactory->request($url, 'GET', [
195195
'headers' => [
196-
'User-Agent' => $this->extConf['userAgent'] ?? 'Kitodo.Presentation Proxy',
196+
'User-Agent' => $this->extConf['userAgent'] ?? 'Kitodo.Presentation',
197197
],
198198

199199
// For performance, don't download content up-front. Rather, we'll

Tests/Functional/Api/PageViewProxyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function sendsUserAgentToTarget(): void
121121
]);
122122

123123
self::assertEquals(200, $response->getStatusCode());
124-
self::assertEquals('Kitodo.Presentation Proxy', (string) $response->getBody());
124+
self::assertEquals('Kitodo.Presentation', (string) $response->getBody());
125125
}
126126

127127
/**

0 commit comments

Comments
 (0)