openswoole / ext-openswoole

Programmatic server for PHP with async IO, coroutines and fibers

Home Page:https://openswoole.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$_SERVER analog not full

Tuezov52 opened this issue · comments

I need to get the request data schema(http or https) and host(site.ru or www.site.ru ). php has $_SERVER['REQUEST_SCHEME'] and $_SERVER['HTTP_HOST']. I've tried, how do I get them?
PS "At the moment, I only see $request->server['request_uri'] and $request->server['query_string']"

The variables you are looking for are in $request->header and are NOT prefixed with 'HTTP_' so:

$request->header['host'] = $_SERVER['HTTP_HOST'], etc..