第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

http請求的header中的os_,net_參數(shù)在 php $_SERVER 無法獲取

http請求的header中的os_,net_參數(shù)在 php $_SERVER 無法獲取

PHP
慕虎7371278 2019-03-11 12:19:11
客戶端在請求時在http請求的header中加入了一些自定義參數(shù),但是以net_,os_,device_開頭的一些參數(shù)在后端無法獲取到。后端使用的 php,打印$_SERVER沒有這些參數(shù) 看了http協(xié)議和cgi協(xié)議也沒有找到相關(guān)說明 不太明白怎么回事
查看完整描述

3 回答

?
慕沐林林

TA貢獻(xiàn)2016條經(jīng)驗 獲得超9個贊

你試一下apache_request_headers() 函數(shù) 獲取一下看能夠獲取到嗎?

查看完整回答
反對 回復(fù) 2019-03-18
?
尚方寶劍之說

TA貢獻(xiàn)1788條經(jīng)驗 獲得超4個贊

找到原因了
不只是net_,os_,device_開頭的一些參數(shù),默認(rèn)情況下nginx會自動drop所有帶下劃線的header
需要設(shè)置 underscores_in_headers on;

If you do not explicitly set underscores_in_headers on;, nginx will silently drop HTTP headers with underscores (which are perfectly valid according to the HTTP standard). This is done in order to prevent ambiguities when mapping headers to CGI variables, as both dashes and underscores are mapped to underscores during that process.
查看完整回答
反對 回復(fù) 2019-03-18
  • 3 回答
  • 0 關(guān)注
  • 629 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號