Php
Java/1.4.1_04 使用者代理與一些 jQuery / Javascript 衝突 (404)
自從幾天前我在我的伺服器上放置了一個新的 javascript 文件以來,我收到了奇怪的 404 日誌。似乎某些 Java 使用者代理與 jQuery (1.6.2) 的某些部分發生衝突。每當有人點擊 404 並發送伺服器變數時,我都會發送一封自動電子郵件。
http_user_agent
Java/1.4.1_04
和 request_uri 如下:/frontend/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f(
之後直接:
/frontend/js/]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,
javascript 的這兩個部分都可以在縮小的 jQuery 原始碼中找到。這
/frontend/js/
是我的 javascript 文件的路徑。我剛剛在 StackOverflow 上閱讀了兩個類似的問題(1和2),但都沒有任何解決方案。我也會在那裡發表評論,但我想知道這裡是否有更多的人有同樣的問題,並解決了它。
有人有線索嗎?
使用者代理與它無關,而且它肯定不會引起問題 - 錯誤的 URL 應該得到 404,這就是這些請求的內容。由於主要解析失敗,這是一些寫得很糟糕的機器人請求一個荒謬的無效路徑(請注意,無效部分都以
"
字元開始和結束?)。花點時間嘲笑那個在他們的機器人的 js 解析器上失敗得如此糟糕的傻瓜,然後繼續忽略 404 並繼續你的一天(或者如果你必須阻止那個使用者代理)。
查看我自己的伺服器日誌,我有幾個這樣的條目分佈在幾個星期內,來自幾個不同的 IP 地址。都具有相似但略有不同的使用者代理。
大多數但並非所有 IP 地址似乎都位於羅馬尼亞。
這是我的日誌樣本:
[02/Aug/2011:23:20:32 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [03/Aug/2011:05:06:30 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [04/Aug/2011:12:03:35 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_11" [06/Aug/2011:15:34:00 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_22" [06/Aug/2011:18:20:46 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_22" [06/Aug/2011:19:40:11 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_25" [07/Aug/2011:07:55:24 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_20" [10/Aug/2011:09:07:47 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_22" [14/Aug/2011:14:53:58 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [16/Aug/2011:21:04:50 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [17/Aug/2011:09:19:12 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [22/Aug/2011:01:50:44 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_26" [22/Aug/2011:19:13:00 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [26/Aug/2011:18:15:06 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [08/Sep/2011:00:00:01 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [10/Sep/2011:16:09:39 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [12/Sep/2011:14:50:15 +0000] "GET /assets/js/,data:c,complete:function(a,b,c)%7bc=a.responseText,a.isResolved()&&(a.done(function(a)%7bc=a%7d),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [13/Sep/2011:14:25:08 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04" [13/Sep/2011:16:14:05 +0000] "GET /assets/js/,data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f( HTTP/1.1" 200 203 "-" "Java/1.6.0_04"
雖然我不相信這個被誤導的機器人會造成任何傷害,但我將遵循此部落格的建議並阻止來自 Java 使用者代理的所有點擊。作為預防措施,您可能希望這樣做。