internal-server-error - 谷歌服务器在隐私浏览模式下的第一个请求给出服务器错误

标签 internal-server-error server-error p3p incognito-mode google-scholar

每当我在 Safari 和 Google Chrome 的私有(private)窗口中运行 url https://scholar.google.com/citations?user=N7m4vIQAAAAJ&hl=en 时,Google 都会给出错误。

它只发生在隐私浏览模式下的第一个请求上。

有人知道为什么这只发生在特定环境中吗? 这种情况从 3 天前就开始了。

-- 错误信息和捕获

服务器错误 很抱歉,处理您的请求时似乎出现了内部服务器错误。我们的工程师已收到通知,正在努力解决该问题。 请稍后再试。

enter image description here

enter image description here

--- 添加

头文件包括

http header 响应 缓存控制:无缓存,必须重新验证 内容编码:gzip 内容类型:文本/html;字符集=UTF-8 日期:2015 年 11 月 16 日星期一 19:35:39 GMT 过期时间:1990 年 1 月 1 日星期五 00:00:00 GMT Pragma:无缓存 服务器:引用 设置 Cookie:NID=73=eF98qod1NpYg7nb03RUToiSiacFgqNoZxQ4CuzqwGlQn53SoR7rHlzO0OExsmYkpRazROCQ3WqKoCsWKFPxp8dZr5pBra6nD1HPcxWUILl9gVAf5Q7GSQc3B0O3TP4gu; expires=2016 年 5 月 17 日星期二 19:35:39 GMT;路径=/;域名=.google.com;仅限HTTP X-Firefox-Spdy: h2 X 框架选项:SAMEORIGIN X-XSS-保护:1;模式= block p3p: CP="这不是 P3P 政策!有关详细信息,请参阅 http://www.google.com/support/accounts/bin/answer.py?hl=zh-CN&answer=151657。" x-content-type-options: 没有嗅​​探

最佳答案

通过在请求 URL 时使用 cookie 解决了这个问题。引用:PHP cURL how to add the User Agent value OR overcome the Servers blocking cURL requests?

我使用 php 脚本来检索和放置一些 cookie 选项。

一段代码是

    $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);

关于internal-server-error - 谷歌服务器在隐私浏览模式下的第一个请求给出服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33741372/

相关文章:

google-apps-script - Google Apps 脚本 setValues() 问题 : timing out intermittently

php - 使用 iframe 将第三方 cookie 设置到 safari。不支持 P3p header

c# - 从 php 页面获取响应

从 5.2.17 升级到 5.3.27 时引入的 PHP 错误

php 管理 session session

ruby-on-rails - 类型错误 - 不能引用 Rack::Session::SessionId

javascript - IE8 - IE10 跨域 JSONP cookie 头疼

java - 收到错误 500 但返回 ok()

google-apps-script - 我已启用 V8 运行时,但在尝试保存 : "We' re Sorry, 时出现错误,发生服务器错误。请稍等,然后再试一次。”

.net - 为什么 ASP.NET 找不到 asp :UpdateProgress?