Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveResource 3.1 Non-ASCII Encoding Bug #4616

Closed
cjolly opened this issue Jan 23, 2012 · 2 comments
Closed

ActiveResource 3.1 Non-ASCII Encoding Bug #4616

cjolly opened this issue Jan 23, 2012 · 2 comments

Comments

@cjolly
Copy link
Contributor

cjolly commented Jan 23, 2012

To reproduce:
Rails ~> 3.1.3
Ruby 1.9.2p.290
ActiveResource::Base.format = :xml
ActiveResource::Base.site set to an https uri.
Some non-ascii chars in the payload

class Post < ActiveResource::Base
  self.site = 'https://secureapi.example.com'
  self.format = :xml
end

post = Post.find(1)
post.title = "Café!"
post.save
... ActiveResource::TimeoutError

Ruby 1.9.2p.290 has an OpenSSL::Buffering bug that affects active resource with ssl sites.

In Rails, JSON appears to be unaffected as it already forces binary encoding in it's encode method.

I believe a well placed .force_encoding(::Encoding::BINARY) in the to_xml chain would fix the issue. I'm not too familiar with the XMLMini code and had trouble finding a place to focus my efforts. I am more than willing to tackle the issue with a little direction, but wanted to get the issue into the open first.

For the time being, here's a workaround I'm using in a production app hosted on Heroku cedar.

@jtmkrueger
Copy link

Is this still a problem?

@carlosantoniodasilva
Copy link
Member

ActiveResource has been extracted to its own repo, so I'll ask you to send a new issue / pull request to there in case you still find this is an issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants