<commit_before><?php
/**
 * @author    <NAME> <<EMAIL>>
 * @copyright 2018
 *
 * @link      https://www.github.com/janhuang
 * @link      http://www.fast-d.cn/
 */

namespace FastD\Http;

use Psr\Http\Message\ServerRequestInterface;
use swoole_http_request;

/**
 * Class SwooleServerRequest
 *
 * @package FastD\Http
 */
class SwooleServerRequest extends ServerRequest
{
    /**
     * @param swoole_http_request $request
     * @return ServerRequestInterface
     */
    public static function createServerRequestFromSwoole(swoole_http_request $request)
    {

        $get = isset($request->get) ? $request->get : [];
        $post = isset($request->post) ? $request->post : [];
        $cookie = isset($request->cookie) ? $request->cookie : [];
        $files = isset($request->files) ? $request->files : [];

        $host = '::1';
        foreach (['host', 'server_addr'] as $name) {
            if (!empty($request->header[$name])) {<commit_msg>获取ip顺序问题<commit_after><?php
/**
 * @author    <NAME> <<EMAIL>>
 * @copyright 2018
 *
 * @link      https://www.github.com/janhuang
 * @link      http://www.fast-d.cn/
 */

namespace FastD\Http;

use Psr\Http\Message\ServerRequestInterface;
use swoole_http_request;

/**
 * Class SwooleServerRequest
 *
 * @package FastD\Http
 */
class SwooleServerRequest extends ServerRequest
{
    /**
     * @param swoole_http_request $request
     * @return ServerRequestInterface
     */
    public static function createServerRequestFromSwoole(swoole_http_request $request)
    {
        $get = isset($request->get) ? $request->get : [];
        $post = isset($request->post) ? $request->post : [];
        $cookie = isset($request->cookie) ? $request->cookie : [];
        $files = isset($request->files) ? $request->files : [];

        $host = '::1';
        foreach (['host', 'server_addr'] as $name) {
            if (!empty($request->header[$name])) {
{'fraction_non_alphanumeric': 0.16859852476290832, 'fraction_numerical': 0.005268703898840885, 'mean_word_length': 3.0063291139240507, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '331349', 'n_tokens_mistral': 603, 'n_tokens_neox': 605, 'n_words': 110}