File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ class SumUp
142142 }
143143
144144 $headers = is_array($config['custom_headers']) ? $config['custom_headers'] : [];
145+ $headers['Accept'] = 'application/problem+json, application/json';
145146 $headers['User-Agent'] = SdkInfo::getUserAgent();
146147 $config['custom_headers'] = $headers;
147148
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ private function normalizeConfig(array $config): array
149149 }
150150
151151 $ headers = is_array ($ config ['custom_headers ' ]) ? $ config ['custom_headers ' ] : [];
152+ $ headers ['Accept ' ] = 'application/problem+json, application/json ' ;
152153 $ headers ['User-Agent ' ] = SdkInfo::getUserAgent ();
153154 $ config ['custom_headers ' ] = $ headers ;
154155
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ class SdkInfoTest extends TestCase
1010{
1111 public function testStandardHeadersIncludeRuntimeMetadata ()
1212 {
13- $ headers = ['Content-Type ' => 'application/json ' , 'User-Agent ' => SdkInfo::getUserAgent ()];
13+ $ headers = [
14+ 'Content-Type ' => 'application/json ' ,
15+ 'Accept ' => 'application/problem+json, application/json ' ,
16+ 'User-Agent ' => SdkInfo::getUserAgent (),
17+ ];
1418 $ headers = array_merge ($ headers , SdkInfo::getRuntimeHeaders ());
1519
1620 $ this ->assertSame ('application/json ' , $ headers ['Content-Type ' ]);
21+ $ this ->assertSame ('application/problem+json, application/json ' , $ headers ['Accept ' ]);
1722 $ this ->assertSame (SdkInfo::getUserAgent (), $ headers ['User-Agent ' ]);
1823 $ this ->assertSame (ApiVersion::CURRENT , $ headers ['X-Sumup-Api-Version ' ]);
1924 $ this ->assertSame ('php ' , $ headers ['X-Sumup-Lang ' ]);
You can’t perform that action at this time.
0 commit comments