- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的生产服务器是 Ubuntu 12 .
我正在使用 设计 + OmniAuth 处理 Google 身份验证。
但是当 Google 将控件返回给我的应用程序时,我收到错误 “网络不可达” .
我认为这是因为服务器位于代理后面。
这是错误描述:
-------------------------------
Request:
-------------------------------
* URL : http://efiling.uipv.org/users/auth/google_oauth2/callback?state=f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43&code=4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI
* IP address: 213.160.144.239
* Parameters: {"state"=>"f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43", "code"=>"4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI"}
* Rails root: /home/test/efiling2
* Timestamp : 2012-08-14 11:22:27 +0300
-------------------------------
Session:
-------------------------------
* session id: "5b45534889547514b01f59e39f21f74a"
* data: {"session_id"=>"5b45534889547514b01f59e39f21f74a",
"_csrf_token"=>"GJAFgiVO3zd/INIW6DqDh/VYGlvoZ8WuEKAX1HseJwA="}
-------------------------------
Environment:
-------------------------------
* CONTENT_LENGTH : 0
* DOCUMENT_ROOT : /home/test/efiling2/public
* HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
* HTTP_ACCEPT_ENCODING : gzip, deflate
* HTTP_ACCEPT_LANGUAGE : ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
* HTTP_CACHE_CONTROL : max-age=0
* HTTP_CONNECTION : keep-alive
* HTTP_COOKIE : _eFiling2_session=BAh7CkkiD3Nlc3Npb25faWQGOgZFRiIlNWI0NTUzNDg4OTU0NzUxNGIwMWY1OWUzOWYyMWY3NGFJIhBfY3NyZl90b2tlbgY7AEZJIjFHSkFGZ2lWTzN6ZC9JTklXNkRxRGgvVllHbHZvWjhXdUVLQVgxSHNlSndBPQY7AEZJIhRvbW5pYXV0aC5wYXJhbXMGOwBGewBJIhRvbW5pYXV0aC5vcmlnaW4GOwBGIidodHRwOi8vZWZpbGluZy51aXB2Lm9yZy8%2FbG9jYWxlPXVrSSITb21uaWF1dGguc3RhdGUGOwBGIjVmNGVhY2E5ZmJlZDJhNzdjMGJhYWM1MGNkYmRjY2FiN2VlZTY3MTE3OWJiOGZjNDM%3D--08b5e8bcf347ac5c845922cbf85f31a24907c100
* HTTP_HOST : efiling.uipv.org
* HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1
* HTTP_VIA : 1.1 proxy.ukrpatent.org (squid/3.1.19)
* HTTP_X_FORWARDED_FOR : 10.11.10.56
* PASSENGER_APP_SPAWNER_IDLE_TIME : -1
* PASSENGER_APP_TYPE : rack
* PASSENGER_CONNECT_PASSWORD : [FILTERED]
* PASSENGER_DEBUGGER : false
* PASSENGER_ENVIRONMENT : development
* PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME : -1
* PASSENGER_FRIENDLY_ERROR_PAGES : true
* PASSENGER_GROUP :
* PASSENGER_MAX_REQUESTS : 0
* PASSENGER_MIN_INSTANCES : 1
* PASSENGER_SHOW_VERSION_IN_HEADER : true
* PASSENGER_SPAWN_METHOD : smart-lv2
* PASSENGER_USER :
* PASSENGER_USE_GLOBAL_QUEUE : true
* PATH_INFO : /users/auth/google_oauth2/callback
* QUERY_STRING : state=f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43&code=4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI
* REMOTE_ADDR : 213.160.144.239
* REMOTE_PORT : 62175
* REQUEST_METHOD : GET
* REQUEST_URI : /users/auth/google_oauth2/callback?state=f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43&code=4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI
* SCGI : 1
* SCRIPT_NAME :
* SERVER_ADDR : 10.10.18.3
* SERVER_NAME : efiling.uipv.org
* SERVER_PORT : 80
* SERVER_PROTOCOL : HTTP/1.1
* SERVER_SOFTWARE : nginx/1.2.2
* UNION_STATION_SUPPORT : false
* _ : _
* action_dispatch.cookies : {"_eFiling2_session"=>"BAh7CkkiD3Nlc3Npb25faWQGOgZFRiIlNWI0NTUzNDg4OTU0NzUxNGIwMWY1OWUzOWYyMWY3NGFJIhBfY3NyZl90b2tlbgY7AEZJIjFHSkFGZ2lWTzN6ZC9JTklXNkRxRGgvVllHbHZvWjhXdUVLQVgxSHNlSndBPQY7AEZJIhRvbW5pYXV0aC5wYXJhbXMGOwBGewBJIhRvbW5pYXV0aC5vcmlnaW4GOwBGIidodHRwOi8vZWZpbGluZy51aXB2Lm9yZy8/bG9jYWxlPXVrSSITb21uaWF1dGguc3RhdGUGOwBGIjVmNGVhY2E5ZmJlZDJhNzdjMGJhYWM1MGNkYmRjY2FiN2VlZTY3MTE3OWJiOGZjNDM=--08b5e8bcf347ac5c845922cbf85f31a24907c100"}
* action_dispatch.parameter_filter : [:password, :efile, /RAW_POST_DATA/]
* action_dispatch.remote_ip : 213.160.144.239
* action_dispatch.request.content_type :
* action_dispatch.request.parameters : {"state"=>"f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43", "code"=>"4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI"}
* action_dispatch.request.path_parameters : {}
* action_dispatch.request.query_parameters : {"state"=>"f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43", "code"=>"4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI"}
* action_dispatch.request.request_parameters : {}
* action_dispatch.request.unsigned_session_cookie: {"session_id"=>"5b45534889547514b01f59e39f21f74a", "_csrf_token"=>"GJAFgiVO3zd/INIW6DqDh/VYGlvoZ8WuEKAX1HseJwA=", "omniauth.params"=>{}, "omniauth.origin"=>"http://efiling.uipv.org/?locale=uk", "omniauth.state"=>"f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43"}
* action_dispatch.secret_token : f7fa3943c0fc9f3b40a9bc5b0260fa43979de183fc338c08ec96277d6aeab1ce7973c188f93e978d4a513a08d871888520f41671d06a15315ffc6c3d43a1abfa
* action_dispatch.show_exceptions : true
* exception_notifier.options : {:sender_address=>"\"Efiling\" <alex_drobazko@uipv.org>", :exception_recipients=>["drobazko@gmail.com"], :email_prefix=>"[Efiling Error Report] ", :sections=>["request", "session", "environment", "backtrace"], :background_sections=>["backtrace", "data"], :verbose_subject=>true, :normalize_subject=>false, :ignore_exceptions=>["ActiveRecord::RecordNotFound", "AbstractController::ActionNotFound", "ActionController::RoutingError"], :ignore_crawlers=>[], :ignore_if=>#<Proc:0xa55f0b4@/home/test/.rvm/gems/ruby-1.9.3-p194/gems/exception_notification-2.6.1/lib/exception_notifier.rb:30 (lambda)>}
* omniauth.origin : http://efiling.uipv.org/?locale=uk
* omniauth.params : {}
* omniauth.strategy : #<OmniAuth::Strategies::GoogleOauth2:0xafdbca4>
* rack.errors : #<IO:0x9a598f4>
* rack.input : #<PhusionPassenger::Utils::RewindableInput:0xafc2718>
* rack.multiprocess : true
* rack.multithread : false
* rack.request.cookie_hash : {"_eFiling2_session"=>"BAh7CkkiD3Nlc3Npb25faWQGOgZFRiIlNWI0NTUzNDg4OTU0NzUxNGIwMWY1OWUzOWYyMWY3NGFJIhBfY3NyZl90b2tlbgY7AEZJIjFHSkFGZ2lWTzN6ZC9JTklXNkRxRGgvVllHbHZvWjhXdUVLQVgxSHNlSndBPQY7AEZJIhRvbW5pYXV0aC5wYXJhbXMGOwBGewBJIhRvbW5pYXV0aC5vcmlnaW4GOwBGIidodHRwOi8vZWZpbGluZy51aXB2Lm9yZy8/bG9jYWxlPXVrSSITb21uaWF1dGguc3RhdGUGOwBGIjVmNGVhY2E5ZmJlZDJhNzdjMGJhYWM1MGNkYmRjY2FiN2VlZTY3MTE3OWJiOGZjNDM=--08b5e8bcf347ac5c845922cbf85f31a24907c100"}
* rack.request.cookie_string : _eFiling2_session=BAh7CkkiD3Nlc3Npb25faWQGOgZFRiIlNWI0NTUzNDg4OTU0NzUxNGIwMWY1OWUzOWYyMWY3NGFJIhBfY3NyZl90b2tlbgY7AEZJIjFHSkFGZ2lWTzN6ZC9JTklXNkRxRGgvVllHbHZvWjhXdUVLQVgxSHNlSndBPQY7AEZJIhRvbW5pYXV0aC5wYXJhbXMGOwBGewBJIhRvbW5pYXV0aC5vcmlnaW4GOwBGIidodHRwOi8vZWZpbGluZy51aXB2Lm9yZy8%2FbG9jYWxlPXVrSSITb21uaWF1dGguc3RhdGUGOwBGIjVmNGVhY2E5ZmJlZDJhNzdjMGJhYWM1MGNkYmRjY2FiN2VlZTY3MTE3OWJiOGZjNDM%3D--08b5e8bcf347ac5c845922cbf85f31a24907c100
* rack.request.query_hash : {"state"=>"f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43", "code"=>"4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI"}
* rack.request.query_string : state=f4eaca9fbed2a77c0baac50cdbdccab7eee671179bb8fc43&code=4/YRcyYZzkrfNh8mEBbenxaxyx5EjN.4snirEA-93MXOl05ti8ZT3a9mXdIcgI
* rack.run_once : false
* rack.session : {"session_id"=>"5b45534889547514b01f59e39f21f74a", "_csrf_token"=>"GJAFgiVO3zd/INIW6DqDh/VYGlvoZ8WuEKAX1HseJwA="}
* rack.session.options : {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"5b45534889547514b01f59e39f21f74a"}
* rack.url_scheme : http
* rack.version : [1, 0]
* warden : Warden::Proxy:92171780 @config={:default_scope=>:user, :scope_defaults=>{}, :default_strategies=>{:user=>[:rememberable, :database_authenticatable]}, :intercept_401=>false, :failure_app=>#<Devise::Delegator:0xbf7cb04>}
* Process: 31617
* Server : STORK
-------------------------------
Backtrace:
-------------------------------
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `open'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `connect'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:744:in `start'
/home/test/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1284:in `request'
rest-client (1.6.7) lib/restclient/net_http_ext.rb:51:in `request'
faraday (0.8.2) lib/faraday/adapter/net_http.rb:73:in `perform_request'
faraday (0.8.2) lib/faraday/adapter/net_http.rb:36:in `call'
faraday (0.8.2) lib/faraday/request/url_encoded.rb:14:in `call'
faraday (0.8.2) lib/faraday/connection.rb:226:in `run_request'
oauth2 (0.8.0) lib/oauth2/client.rb:88:in `request'
oauth2 (0.8.0) lib/oauth2/client.rb:131:in `get_token'
oauth2 (0.8.0) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
omniauth-oauth2 (1.1.0) lib/omniauth/strategies/oauth2.rb:100:in `build_access_token'
omniauth-oauth2 (1.1.0) lib/omniauth/strategies/oauth2.rb:75:in `callback_phase'
omniauth (1.1.0) lib/omniauth/strategy.rb:219:in `callback_call'
omniauth (1.1.0) lib/omniauth/strategy.rb:175:in `call!'
omniauth (1.1.0) lib/omniauth/strategy.rb:157:in `call'
sass (3.1.20) lib/sass/plugin/rack.rb:54:in `call'
exception_notification (2.6.1) lib/exception_notifier.rb:34:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.9) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.9) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.9) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.9) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.9) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.9) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.9) lib/rails/application.rb:168:in `call'
railties (3.0.9) lib/rails/application.rb:77:in `method_missing'
passenger (3.0.14) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.14) lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
passenger (3.0.14) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.14) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
passenger (3.0.14) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
passenger (3.0.14) lib/phusion_passenger/utils.rb:470:in `safe_fork'
passenger (3.0.14) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
passenger (3.0.14) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.14) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.14) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.14) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
passenger (3.0.14) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
passenger (3.0.14) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.14) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
passenger (3.0.14) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
passenger (3.0.14) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.14) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.14) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.14) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.14) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.14) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.14) helper-scripts/passenger-spawn-server:99:in `<main>'
最佳答案
我已经通过使用猴子修补 Oauth2 解决了问题。
require 'faraday'
module OAuth2
# The OAuth2::Client class
class Client
# The Faraday connection object
def connection
options[:connection_opts].merge!({:proxy => 'http://10.10.16.8:3128'})
@connection ||= begin
conn = Faraday.new(site, options[:connection_opts])
conn.build do |b|
options[:connection_build].call(b)
end if options[:connection_build]
conn
end
end
end
end
关于ruby-on-rails - Omniauth + Google + Faraday + 背后代理 = 怎么设置代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11948656/
这个问题已经有答案了: Is there any way to accept only numeric values in a JTextField? (20 个回答) It's possible i
我使用戴尔 XPS M1710。笔记本电脑的盖子、侧面扬声器和前置扬声器都有灯(3 组灯可以单独调节)和鼠标垫下方的灯。在 BIOS 中,我可以更改这些灯的颜色,至少是每个组。另外,我可以在鼠标垫下打
我知道我可以使用 在 iOS 5 中打开设置应用 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"
我有一个 Django 应用程序,我正在尝试为其设置文档。目录结构如下: - doc - project | - manage.py 我已经设置了路径以便 Sphinx 可以看到东西,但是当我尝试使用
我正在使用 768mb ram 运行 centos 5.5。我一直在日志中获取 server reached MaxClients setting, consider raising the MaxC
我在具有以下配置的服务器内运行了 Drupal 安装: StartServers 5 MinSpareServers 5 MaxSpareServers 15 MaxClien
是否可以使用 Microsoft.Web.Administration 包为给定的 location 配置 asp 设置? 我想以编程方式将以下部分添加到本地 IIS applicationHost.
我一直在阅读为 kube-proxy 提供参数的文档,但没有解释应该如何使用这些参数。我使用 az aks create 创建我的集群使用 azure-cli 程序,然后我获得凭据并使用 kubect
我想知道与在 PHP 中使用 setcookie() 函数相比,在客户端通过 JavaScript 设置一些 cookie 是否有任何明显的优势?我能想到的唯一原因是减少一些网络流量(第一次)。但不是
我有一个按钮可以将 body class 设置为 .blackout 我正在使用 js-cookie设置cookie,下面的代码与我的按钮相关联。 $('#boToggle').on('click'
我有一堆自定义的 HTML div。我将其中的 3 存储在具有 slide 类的 div 中。然后,我使用该幻灯片类调用 slick 函数并应用如下设置: $('.slide').slick({
我正在创建一个应该在 Windows 8(桌面)上运行的应用 我需要: 允许用户使用我的应用启动“文件历史记录”。我需要找到打开“文件历史记录”的命令行。 我需要能够显示“文件历史记录”的当前设置。
我刚买了一台新的 MacBook Pro,并尝试在系统中设置 RVM。我安装了 RVM 并将默认设置为 ➜ rvm list default Default Ruby (for new shells)
由于有关 Firestore 中时间戳行为即将发生变化的警告,我正在尝试更改我的应用的初始化代码。 The behavior for Date objects stored in Firestore
在 ICS 中,网络 -> 数据使用设置屏幕中现在有“限制后台数据”设置。 有没有办法以编程方式为我的应用程序设置“限制后台数据”? 或 有没有办法为我的应用程序调出具有选项的“数据使用”设置? 最佳
我正在尝试使用 NextJS 应用程序设置 Jest,目前在 jest.config.js : module.exports = { testPathIgnorePatterns: ["/.n
我最近升级到 FlashDevelop 4,这当然已经将我之前的所有设置恢复到原来的状态。 我遇到的问题是我无法在新设置窗口的哪个位置找到关闭它在方括号、大括号等之前插入的自动空格的选项。 即它会自动
有没有办法以编程方式访问 iPhone/iPod touch 设置? 谢谢。比兰奇 最佳答案 大多数用户设置可以通过读取存储在 /User/Library/Preferences/ 中的属性列表来访问
删除某些值时,我需要选择哪些设置来维护有序队列。我创建了带有自动增量和主键的 id 的表。当我第一次插入值时,没问题。就像 1,2,3,4,5... 当删除某些值时,顺序会发生变化,例如 1,5,3.
我正在尝试设置示例 Symfony2 项目,如此处所示 http://symfony.com/doc/current/quick_tour/the_big_picture.html 在访问 confi
我是一名优秀的程序员,十分优秀!