GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I've trying to see if my USPS credentials are valid, but I'm getting NoMethodError: undefined method `name' for nil:NilClass.
I jumped into the code and it seems that the response from USPS is gzipped.
My very bad solution for this in active_shipping/shipping/carriers/usps.rb
def commit(action, request, test = false)
response = ssl_get(request_url(action, request, test))
response.include?('xml') ? response : Zlib::GzipReader.new(StringIO.new(response)).read
I would imagine there is a better way to test if the string is gzipped or to request that it not be gzipped in the first place. I have a pretty basic setup and spent a few hours tracking this down. I didn't expect 2 basic lines in the tutorial to cause so much trouble.