altmetric / embiggen

A Ruby library to expand shortened URLs
https://rubygems.org/gems/embiggen
MIT License
124 stars 6 forks source link

Handle unencoded Location headers #7

Closed mudge closed 9 years ago

mudge commented 9 years ago

GitHub: https://github.com/altmetric/embiggen/issues/4

In production, we've seen a few shorteners return unencoded URIs in their Location headers (contrary to the RFC 7231 specification). We could use URI.escape and URI.unescape to deal with these but they have been deprecated. Instead, bring in the Addressable gem as a dependency to handle normalisation.

This means that Embiggen now returns Addressable::URIs rather than Ruby standard library URIs which is a breaking API change if you rely on URI-specific features (e.g. port which is much stricter with Addressable).

omartell commented 9 years ago

did you find out if Addressable is Ruby 1.8.7 compatible?

mudge commented 9 years ago

Yup, the Travis CI build builds against 1.8.7.