July 2010
2 posts
YAML formats are not lossless
Recently I was using YAML files to package up content to send across the wire. A part of this included a checksum and signature of the contents to ensure that it wasn’t modified, and that it came from a trusted source. I ran into an issue where some of the content wouldn’t sign properly on the receiving side. A lot of digging later turned up that parsing yaml content in ruby with...
Jul 22nd
Ruby 1.9.1 modifies request headers
I just ran across something in Ruby 1.9.1 that definitely violates the least-surprise principle (at least to me). It is in Net::HTTP#get. def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+ res = nil if HAVE_ZLIB unless initheader.keys.any?{|k| k.downcase == "accept-encoding"} initheader["accept-encoding"] =...
Jul 13th
1 note