• <b id="l3qpx"><abbr id="l3qpx"></abbr></b>
  • <th id="l3qpx"><progress id="l3qpx"></progress></th>
      <th id="l3qpx"></th>
      <dd id="l3qpx"><font id="l3qpx"></font></dd>
      <th id="l3qpx"></th>
      0712-2888027 189-8648-0214
      微信公眾號(hào)

      孝感風(fēng)信網(wǎng)絡(luò)科技有限公司微信公眾號(hào)

      當(dāng)前位置:主頁(yè) > 技術(shù)支持 > PHP > 升級(jí)至Laravel 5.7報(bào)錯(cuò)setTrustedProxies() must be of the type integer的處理

      升級(jí)至Laravel 5.7報(bào)錯(cuò)setTrustedProxies() must be of the type integer的處理

      時(shí)間:2018-12-06來(lái)源:風(fēng)信官網(wǎng) 點(diǎn)擊: 2413次
      報(bào)錯(cuò)信息如下:
       
      Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Argument 2 passed to Symfony\Component\HttpFoundation\Request::
      setTrustedProxies() must be of the type integer, array given, called in D:\phpStudy\Laravel5.5\vendor\fideloper\proxy\src\TrustProxies.php on line 54"

      升級(jí)至Laravel 5.7報(bào)錯(cuò)setTrustedProxies() must be of the type integer的處理
       
      查閱文檔發(fā)現(xiàn)是由于Symfony HttpFoundation 的可信任代理功能發(fā)生了根本性的改變,需要調(diào)整中是間件。
       
      打開 App\Http\Middleware\TrustProxies
       
      將代碼:
       
      protected $headers = [
              Request::HEADER_FORWARDED => 'FORWARDED',
              Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
              Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
              Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
              Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
          ];
       
      修改為:
       
      protected $headers = Request::HEADER_X_FORWARDED_ALL;
       
      再次測(cè)試正常。
      熱門關(guān)鍵詞: 升級(jí) Laravel 5.7 setTrustedProxies()
      欄目列表
      推薦內(nèi)容
      熱點(diǎn)內(nèi)容
      展開
      欧美一区二区三区免费A级视频,亚洲精品中文字幕综合,动漫精品中文字幕无码第一页,1024亚洲国产综合 亚太影院 柯西贝尔-游戏赚网
    1. <b id="l3qpx"><abbr id="l3qpx"></abbr></b>
    2. <th id="l3qpx"><progress id="l3qpx"></progress></th>
        <th id="l3qpx"></th>
        <dd id="l3qpx"><font id="l3qpx"></font></dd>
        <th id="l3qpx"></th>