【发布时间】:2018-07-07 04:32:01
【问题描述】:
ArgumentError in Users::OmniauthCallbacksController#google_oauth2
header field value cannot include CR/LF
真的不确定这个错误来自哪里。
我正在使用 ruby 2.5、Rails 5 和 google-api-client 0.8.2
任何想法如何解决或我可以提供什么信息来使这个问题更具信息性?
更新:当我尝试使用 Google 的 API 进行授权时,我的日志显示了这一点
Google::APIClient::Request Sending API request get https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest {"User-Agent"=>"hello U/1.0.0 google-api-ruby-client/0.8.2 Mac OS X/10.13.4\n (gzip)", "Accept-Encoding"=>"gzip", "Content-Type"=>""}
根据我的研究,CRLF 是“\r\n”字符,对吧?
所以"User-Agent"=>"hello U/1.0.0 google-api-ruby-client/0.8.2 Mac OS X/10.13.4\n
可能是问题所在。
所以我的问题是——如何在我的请求中访问用户代理来解决 Rails 5 的这个问题?
【问题讨论】:
标签: ruby-on-rails google-calendar-api google-api-ruby-client