markevans/dragonfly — pull request #191 by cheald (2012-05-03 09:41:04+00:00)
Title: More robust URL signing

I love Dragonfly, but it's unusable if you have any CDNs or public proxies that do not use query strings. Specifically, Amazon's Cloudfront CDN does not pass query strings through to the origin server, and does not vary the content based on the query string.

To that end, I've rewritten the image signing so that the signature is simply a job step and is thus a part of the base64-encoded portion of the URL. This step is excluded when computing the signature, and `validate_sha!` looks for a Sig step and compares its first parameter to the job signature.