File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ public function createRequest(Request $symfonyRequest)
58
58
);
59
59
60
60
foreach ($ symfonyRequest ->headers ->all () as $ name => $ value ) {
61
- $ request = $ request ->withHeader ($ name , $ value );
61
+ try {
62
+ $ request = $ request ->withHeader ($ name , $ value );
63
+ } catch (\InvalidArgumentException $ e ) {
64
+ // ignore invalid header
65
+ }
62
66
}
63
67
64
68
$ body = $ this ->streamFactory ->createStreamFromResource ($ symfonyRequest ->getContent (true ));
@@ -160,7 +164,11 @@ public function createResponse(Response $symfonyResponse)
160
164
}
161
165
162
166
foreach ($ headers as $ name => $ value ) {
163
- $ response = $ response ->withHeader ($ name , $ value );
167
+ try {
168
+ $ response = $ response ->withHeader ($ name , $ value );
169
+ } catch (\InvalidArgumentException $ e ) {
170
+ // ignore invalid header
171
+ }
164
172
}
165
173
166
174
$ protocolVersion = $ symfonyResponse ->getProtocolVersion ();
You can’t perform that action at this time.
0 commit comments