首頁 繪圖設計 工作閒聊 比賽活動 美術討論 標籤 圖片
Chrome "undefined" appended URL causes 404 Not Found
Type(Type) 2012/10/28 20:50

Random "undefined" appended URL causes 404 Not Found @ Chrome



有發現一些怪現象,尤其是這個 Chrome 18 or Chrome 22 這個瀏覽器
會導致約有 0.08% 的機率,隨機的要求 "undefined" 這個物件,
但是明明網站沒有任何 undefined 的物件。


Guess: 猜測是 Windows Chrome 22 版本的 BUG?

User-Agent:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4



171 / 212627 = 0.08%



代碼:

$ wc  access.log
    212627  3844687 53484813

$ grep -r "undefined HTTP" access.log | wc
    171    3097   37608

$ grep -r "undefined HTTP" access.log | grep Safari | wc
    169    3047   37099

$ grep -r "undefined HTTP" access.log | grep 'Safari/537' | wc
    168    3028   36855

$ grep -r "undefined HTTP" access.log | grep 'Safari/537' | grep -i 'Chrome' | wc
    169    3046   37079




上述實際 access.log 測試結果。
Type(Type) 2012/10/31 12:24

IE 好像也會造成 Undefined,Chrome 佔多數



發生的機率非常低,使用者應該也沒感覺(因為這是 Server 端記錄到的)
不確定誰造成的
Google Plus +1 Button Javascript
- Google Adsense Javascript
- Google Analytics Javascript
- Facebook Like-Button Javascript

代碼:

$ grep "undefined" access.log.1 | wc
     76    1407   17419

$  grep "undefined" access.log.1 | grep Chrome | wc
     67    1223   15192

$  grep "undefined" access.log.1 | grep IE | wc
      9     184    2227

$  grep "undefined" access.log.1 | grep Firefox | wc
      0       0       0


Type(Type) 2012/11/30 13:56 (Since 2012/11/30 13:47)

The "random /undefined 404" symptom still exists there



Seemingly most of them are __STILL__ "Google Chrome 23" clients.

If you already prepare some customzied HTTP-404-Not-Found handle script,
you may want to add some early-exit to save your CPU%.

your-404-not-found.php
代碼:

<?PHP

# ... SNIP ... your code

$undef_str = substr($_SERVER['REQUEST_URI'], -10, 10);

if ($undef_str == '/undefined')
{
    echo 'http://vovo2000.com';
    exit;
}

# ... SNIP ... your code

?>


(3,046 views)
[更多討論] 討論區 Windows, Linux, Perl, PHP, C/C++, Driver, Web 理論、應用、硬體、軟體

"Chrome "undefined" appended URL causes 404 Not Found" 傳統頁面(電腦版)

首頁 繪圖設計 工作閒聊 比賽活動 美術討論 標籤 圖片
傳統桌面版 [ 登入/註冊 ]
© Vovo2000.com Mobile Version 小哈手機版 2024