sender = $request->getClientIp(); $this->uri = $request->getRequestUri(); $this->origin = $request->headers->get('Origin'); $this->expected_method = $request->headers->get('Access-Control-Request-Method'); $this->allows_credentials = $allows_credentials; $tmp = $request->headers->get("Access-Control-Request-Headers"); if (!empty($tmp)) { $hs = explode(',', $tmp); foreach ($hs as $h) { array_push($this->expected_custom_headers, strtoupper(trim($h))); } } } /** * @return array */ public function toArray() { $res = []; $res['sender'] = $this->sender; $res['uri'] = $this->uri; $res['origin'] = $this->origin; $res['allows_credentials'] = $this->allows_credentials; $res['expected_method'] = $this->expected_method; $res['expected_custom_headers'] = implode(',', $this->expected_custom_headers); return $res; } }