Google Server在私有浏览模式下的第一个请求给出服务器错误 [英] Google Server gives a server error with the first request in private browsing mode
问题描述
每当我在Safari和Google Chrome的私有窗口中运行网址https://scholar.google.com/citations?user=N7m4vIQAAAAJ&hl=en
时,Google都会给出错误消息.
Whenever I run the url https://scholar.google.com/citations?user=N7m4vIQAAAAJ&hl=en
in private windows of Safari and Google Chrome, Google gives an errors.
仅在具有私有浏览模式的第一个请求上发生.
It happens only on the first request with private browsing mode.
任何人都知道为什么仅在特定环境下会发生这种情况吗? 自3天前开始发生这种情况.
Anybody knows why this happens only in specific environment? This has been happening since 3 days ago.
-错误消息和捕获内容
Server Error
We're sorry but it appears that there has been an internal server error while processing your request. Our engineers have been notified and are working to resolve the issue.
Please try again later.
Server Error
We're sorry but it appears that there has been an internal server error while processing your request. Our engineers have been notified and are working to resolve the issue.
Please try again later.
---已添加
头文件包括
http header response
Cache-Control: no-cache, must-revalidate
Content-Encoding: gzip
Content-Type: text/html; charset=UTF-8
Date: Mon, 16 Nov 2015 19:35:39 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: citations
Set-Cookie: NID=73=eF98qod1NpYg7nb03RUToiSiacFgqNoZxQ4CuzqwGlQn53SoR7rHlzO0OExsmYkpRazROCQ3WqKoCsWKFPxp8dZr5pBra6nD1HPcxWUILl9gVAf5Q7GSQc3B0O3TP4gu; expires=Tue, 17-May-2016 19:35:39 GMT; path=/; domain=.google.com; HttpOnly
X-Firefox-Spdy: h2
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
p3p: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
x-content-type-options: no sniff
http header response
Cache-Control: no-cache, must-revalidate
Content-Encoding: gzip
Content-Type: text/html; charset=UTF-8
Date: Mon, 16 Nov 2015 19:35:39 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: citations
Set-Cookie: NID=73=eF98qod1NpYg7nb03RUToiSiacFgqNoZxQ4CuzqwGlQn53SoR7rHlzO0OExsmYkpRazROCQ3WqKoCsWKFPxp8dZr5pBra6nD1HPcxWUILl9gVAf5Q7GSQc3B0O3TP4gu; expires=Tue, 17-May-2016 19:35:39 GMT; path=/; domain=.google.com; HttpOnly
X-Firefox-Spdy: h2
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
p3p: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
x-content-type-options: no sniff
推荐答案
Fixed the issue by having cookies when it requests URLs. REF: PHP cURL how to add the User Agent value OR overcome the Servers blocking cURL requests?
我使用php脚本来检索并放置一些cookie选项.
I use php scripts to retrieve and put some cookie options.
一个代码段是
$curl = curl_init($url);
$dir = dirname(__FILE__);
$config['cookie_file'] = $dir . '/cookies/' . md5($_SERVER['REMOTE_ADDR']) . '.txt';
curl_setopt($curl, CURLOPT_COOKIEFILE, $config['cookie_file']);
curl_setopt($curl, CURLOPT_COOKIEJAR, $config['cookie_file']);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($curl);
curl_close($curl);
这篇关于Google Server在私有浏览模式下的第一个请求给出服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!