Skip to content

Commit 3491918

Browse files
committed
[BrowserKit, HttpClient] Minor updates in the default user agents
1 parent 357acda commit 3491918

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

AmpHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function request(string $method, string $url, array $options = []): Respo
9898
}
9999

100100
if (!isset($options['normalized_headers']['user-agent'])) {
101-
$options['headers'][] = 'User-Agent: SymfonyHttpClient (Amp)';
101+
$options['headers'][] = 'User-Agent: Symfony HttpClient (Amp)';
102102
}
103103

104104
if (0 < $options['max_duration']) {

CurlHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function request(string $method, string $url, array $options = []): Respo
9393
$url = implode('', $url);
9494

9595
if (!isset($options['normalized_headers']['user-agent'])) {
96-
$options['headers'][] = 'User-Agent: SymfonyHttpClient (Curl)';
96+
$options['headers'][] = 'User-Agent: Symfony HttpClient (Curl)';
9797
}
9898

9999
$curlopts = [

NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function request(string $method, string $url, array $options = []): Respo
191191
$this->logger?->info(sprintf('Request: "%s %s"', $method, implode('', $url)));
192192

193193
if (!isset($options['normalized_headers']['user-agent'])) {
194-
$options['headers'][] = 'User-Agent: SymfonyHttpClient (Native)';
194+
$options['headers'][] = 'User-Agent: Symfony HttpClient (Native)';
195195
}
196196

197197
if (0 < $options['max_duration']) {

Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public static function provideCurlRequests(): iterable
193193
--url %1$shttp://localhost:8057/json%1$s \\
194194
--header %1$sAccept: */*%1$s \\
195195
--header %1$sAccept-Encoding: gzip%1$s \\
196-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s',
196+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s',
197197
];
198198
yield 'GET with base uri' => [
199199
[
@@ -209,7 +209,7 @@ public static function provideCurlRequests(): iterable
209209
--url %1$shttp://localhost:8057/json/1%1$s \\
210210
--header %1$sAccept: */*%1$s \\
211211
--header %1$sAccept-Encoding: gzip%1$s \\
212-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s',
212+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s',
213213
];
214214
yield 'GET with resolve' => [
215215
[
@@ -229,7 +229,7 @@ public static function provideCurlRequests(): iterable
229229
--url %1$shttp://localhost:8057/json%1$s \\
230230
--header %1$sAccept: */*%1$s \\
231231
--header %1$sAccept-Encoding: gzip%1$s \\
232-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s',
232+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s',
233233
];
234234
yield 'POST with string body' => [
235235
[
@@ -247,7 +247,7 @@ public static function provideCurlRequests(): iterable
247247
--header %1$sContent-Length: 9%1$s \\
248248
--header %1$sContent-Type: application/x-www-form-urlencoded%1$s \\
249249
--header %1$sAccept-Encoding: gzip%1$s \\
250-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s \\
250+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
251251
--data %1$sfoobarbaz%1$s',
252252
];
253253
yield 'POST with array body' => [
@@ -285,7 +285,7 @@ public function __toString(): string
285285
--header %1$sContent-Type: application/x-www-form-urlencoded%1$s \\
286286
--header %1$sContent-Length: 211%1$s \\
287287
--header %1$sAccept-Encoding: gzip%1$s \\
288-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s \\
288+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
289289
--data %1$sfoo=fooval%1$s --data %1$sbar=barval%1$s --data %1$sbaz=bazval%1$s --data %1$sfoobar[baz]=bazval%1$s --data %1$sfoobar[qux]=quxval%1$s --data %1$sbazqux[0]=bazquxval1%1$s --data %1$sbazqux[1]=bazquxval2%1$s --data %1$sobject[fooprop]=foopropval%1$s --data %1$sobject[barprop]=barpropval%1$s --data %1$stostring=tostringval%1$s',
290290
];
291291

@@ -312,7 +312,7 @@ public function __toString(): string
312312
--url %1$shttp://localhost:8057/?foo=fooval&bar=newbarval&foobar[baz]=bazval&foobar[qux]=quxval&bazqux[0]=bazquxval1&bazqux[1]=bazquxval2%1$s \\
313313
--header %1$sAccept: */*%1$s \\
314314
--header %1$sAccept-Encoding: gzip%1$s \\
315-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s',
315+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s',
316316
];
317317
yield 'POST with json' => [
318318
[
@@ -336,7 +336,7 @@ public function __toString(): string
336336
--header %1$sAccept: */*%1$s \\
337337
--header %1$sContent-Length: 120%1$s \\
338338
--header %1$sAccept-Encoding: gzip%1$s \\
339-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s \\
339+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
340340
--data %1$s{"foo":{"bar":"baz","qux":[1.1,1.0],"fred":["\u003Cfoo\u003E","\u0027bar\u0027","\u0022baz\u0022","\u0026blong\u0026"]}}%1$s',
341341
];
342342
}
@@ -368,7 +368,7 @@ public function testItDoesNotFollowRedirectionsWhenGeneratingCurlCommands()
368368
--header %1$sAccept: */*%1$s \\
369369
--header %1$sAuthorization: Basic Zm9vOmJhcg==%1$s \\
370370
--header %1$sAccept-Encoding: gzip%1$s \\
371-
--header %1$sUser-Agent: SymfonyHttpClient (Native)%1$s', '\\' === \DIRECTORY_SEPARATOR ? '"' : "'"), $curlCommand
371+
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s', '\\' === \DIRECTORY_SEPARATOR ? '"' : "'"), $curlCommand
372372
);
373373
}
374374

0 commit comments

Comments
 (0)