@@ -48,7 +48,6 @@ public function bootstrap($appBootstrap, $appenv, $debug)
48
48
$ appBootstrap = $ this ->normalizeAppBootstrap ($ appBootstrap );
49
49
50
50
$ this ->bootstrap = new $ appBootstrap ($ appenv , $ debug );
51
-
52
51
if ($ this ->bootstrap instanceof BootstrapInterface) {
53
52
$ this ->application = $ this ->bootstrap ->getApplication ();
54
53
}
@@ -124,7 +123,6 @@ protected function mapRequest(ReactRequest $reactRequest)
124
123
$ headers = $ reactRequest ->getHeaders ();
125
124
$ query = $ reactRequest ->getQuery ();
126
125
127
- $ cookies = [];
128
126
$ _COOKIE = [];
129
127
130
128
$ sessionCookieSet = false ;
@@ -133,7 +131,6 @@ protected function mapRequest(ReactRequest $reactRequest)
133
131
$ headersCookie = explode ('; ' , isset ($ headers ['Cookie ' ]) ? $ headers ['Cookie ' ] : $ headers ['cookie ' ]);
134
132
foreach ($ headersCookie as $ cookie ) {
135
133
list ($ name , $ value ) = explode ('= ' , trim ($ cookie ));
136
- $ cookies [$ name ] = $ value ;
137
134
$ _COOKIE [$ name ] = $ value ;
138
135
139
136
if ($ name === session_name ()) {
@@ -150,23 +147,6 @@ protected function mapRequest(ReactRequest $reactRequest)
150
147
session_id (Utils::generateSessionId ());
151
148
}
152
149
153
- $ _SERVER ['PHP_AUTH_USER ' ] = '' ;
154
- $ _SERVER ['PHP_AUTH_PW ' ] = '' ;
155
- $ _SERVER ['AUTH_TYPE ' ] = '' ;
156
-
157
- if (isset ($ headers ['Authorization ' ])) {
158
- $ authorizationHeader = $ headers ['Authorization ' ];
159
- $ authorizationHeaderParts = explode (' ' , $ authorizationHeader );
160
- $ type = $ authorizationHeaderParts [0 ];
161
- if (($ type === 'Basic ' || $ type === 'Digest ' ) && isset ($ authorizationHeaderParts [1 ])) {
162
- $ credentials = base64_decode ($ authorizationHeaderParts [1 ]);
163
- $ credentialsParts = explode (': ' , $ credentials );
164
- $ _SERVER ['PHP_AUTH_USER ' ] = isset ($ credentialsParts [0 ]) ? $ credentialsParts [0 ] : '' ;
165
- $ _SERVER ['PHP_AUTH_PW ' ] = isset ($ credentialsParts [1 ]) ? $ credentialsParts [1 ] : '' ;
166
- $ _SERVER ['AUTH_TYPE ' ] = $ type ;
167
- }
168
- }
169
-
170
150
$ files = $ reactRequest ->getFiles ();
171
151
$ post = $ reactRequest ->getPost ();
172
152
@@ -177,10 +157,10 @@ protected function mapRequest(ReactRequest $reactRequest)
177
157
$ class = '\Symfony\Component\HttpFoundation\Request ' ;
178
158
}
179
159
180
- $ syRequest = new $ class ($ query , $ post , $ attributes = [], $ cookies , $ files , $ _SERVER , $ reactRequest ->getBody ());
160
+ /** @var SymfonyRequest $syRequest */
161
+ $ syRequest = new $ class ($ query , $ post , $ attributes = [], $ _COOKIE , $ files , $ _SERVER , $ reactRequest ->getBody ());
181
162
182
163
$ syRequest ->setMethod ($ method );
183
- $ syRequest ->headers ->add ($ headers );
184
164
185
165
return $ syRequest ;
186
166
}
0 commit comments