summon/summon.rb — Issue #16: unicode params throw off header validation with ruby 1.9.2 string encodings
Author: cowboyd
Created: 2011-11-15 22:13:54+00:00
State: open

Every time I try to perform a search using unicode parameters using
the gem, I get a 401 error. Is there a technique for making this work?

Every time I try to perform a search using unicode parameters using
the gem, I get a 401 error. Is there a technique for making this work?

Here's a transcript from the console:

>> Summon::Service.new(APP_CONFIG[:summon]).search('s.q' => 'test') => {records: 21775513, pages: 1451701, query_time: 1613ms, request_time: 1642ms}
>> Summon::Service.new(APP_CONFIG[:summon]).search("s.q"=>"オ ークション方式による掟破りの株式公開プロセス ーグル:上場しても「らしさ」を失わない")
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
/Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/qstring.rb:23:
warning: regexp match /.../n against to UTF-8 string
Summon::Transport::AuthorizationError: 401: Unauthorized
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/http.rb:60:in
`block (2 levels) in urlget'
from /Users/foo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:627:in
`start'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/http.rb:48:in
`block in urlget'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/service.rb:44:in
`report'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/http.rb:28:in
`urlget'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/transport/http.rb:24:in
`get'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/service.rb:39:in
`connect'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/summon-1.2.7/lib/summon/service.rb:22:in
`search'
from (irb):8
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in
`start'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in
`start'
from /Users/foo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:40:in
`'
from script/rails:6:in `require'
from script/rails:6:in `

'