Closed gfeil closed 12 years ago
I heard back from 37signals, and it turns out they were always responding with HTML on authentication failures. This has been reported to be fixed, so this may not be as important now.
See this pull request: https://github.com/collectiveidea/tinder/pull/30
Can I close this now?
I'm not working on Campfire integrations currently, so I'll go ahead and close this.
According to the Campfire API documentation (http://developer.37signals.com/campfire/), it's expected for clients to set the Content-type header explicitly when sending JSON or XML requests. [I know, it's redundant, the content type should be inferred from the dot-extension of the request.] Occasionally a request that's properly authenticated, but rejected by Campfire for other reasons (possibly the account being disabled), a 302 redirect is returned with an HTML formatted message. This causes a lexical parsing error in YAJL. Following is a stack trace:
MultiJson::DecodeError: lexical error: invalid char in json text.
You are being <a hr (right here) ------^ …8/gems/multi_json-1.0.3/lib/multi_json/engines/yajl.rb: 10:inparse' …8/gems/multi_json-1.0.3/lib/multi_json/engines/yajl.rb: 10:in
decode' …undle/ruby/1.8/gems/multi_json-1.0.3/lib/multi_json.rb: 65:indecode' …ay_middleware-0.6.5/lib/faraday/response/parse_json.rb: 16:in
parse' …le/ruby/1.8/gems/faraday-0.6.1/lib/faraday/response.rb: 17:inon_complete' …le/ruby/1.8/gems/faraday-0.6.1/lib/faraday/response.rb: 9:in
call' …le/ruby/1.8/gems/faraday-0.6.1/lib/faraday/response.rb: 62:inon_complete' …le/ruby/1.8/gems/faraday-0.6.1/lib/faraday/response.rb: 8:in
call' …le/ruby/1.8/gems/faraday-0.6.1/lib/faraday/response.rb: 8:incall' …uby/1.8/gems/faraday-0.6.1/lib/faraday/request/json.rb: 28:in
call' …dle/ruby/1.8/gems/faraday-0.6.1/lib/faraday/request.rb: 88:inrun' …dle/ruby/1.8/gems/faraday-0.6.1/lib/faraday/request.rb: 28:in
run' …/ruby/1.8/gems/faraday-0.6.1/lib/faraday/connection.rb: 170:inrun_request' …/ruby/1.8/gems/faraday-0.6.1/lib/faraday/connection.rb: 64:in
get' …le/ruby/1.8/gems/tinder-1.7.0/lib/tinder/connection.rb: 82:inget' …ndle/ruby/1.8/gems/tinder-1.7.0/lib/tinder/campfire.rb: 34:in
rooms' …ndle/ruby/1.8/gems/tinder-1.7.0/lib/tinder/campfire.rb: 41:in `find_room_by_id'