When default/fallback URL contains query, the options are thrown away

Bug #1219117 reported by Miro Hrončok
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Libravatar (obsolete)
Triaged
Medium
Unassigned
Fedora
New
Undecided
Unassigned

Bug Description

Imagine this Python example:

libravatar.libravatar_url(email='fo',default='https://launchpadlibrarian.net/74643267/64.png?b=3&g=8&c=5')

This will produce:

http://cdn.libravatar.org/avatar/eed807024939b808083f0031a56e9872?d=https%3A%2F%2Flaunchpadlibrarian.net%2F74643267%2F64.png%3Fb%3D3%26g%3D8%26c%3D5

That's fine, but not the whole URL including the query string is passed as an default image, but only the URl without options.

Most importantly, this makes it impossible to use workflow similar to this:

libravatar(dafult=gravatar(default=my_image))

So this piece of code doesn't work as expected:

       query = {
            's': size,
            'd': absolute_default,
        }

        query = urllib.urlencode(query)

        gravatar_hash = md5(email).hexdigest()
        gravatar_url = "https://secure.gravatar.com/avatar/%s?%s" % (gravatar_hash, query)

        return libravatar.libravatar_url(
            openid=openid,
            size=size,
            default=gravatar_url,
        )

summary: - When default/fallback URL contains URL with options, the options are
- thrown away
+ When default/fallback URL contains query, the options are thrown away
Revision history for this message
François Marier (fmarier) wrote :

Interesting, falling back to email when the OpenID isn't found on Libravatar.org...

Changed in libravatar:
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → François Marier (fmarier)
Revision history for this message
Miro Hrončok (churchyard) wrote :

Are we getting anywhere with this? It really bothers us.

Thanks

Revision history for this message
François Marier (fmarier) wrote :

Sorry Miro, it looks like this had dropped off of my radar. I apologized.

I just took a quick look and it seems that this Apache directive is not working as expected:

  https://gitorious.org/libravatar/libravatar/source/af9deeea2e8ce1f0c33ea1ee06b43809fd167ed7:config/cdn-common.apache2.conf#L87

I'll have to try and reproduce the problem outside of Libravatar with a simpler Apache config to see if I can work around this and find a way to fix it without breaking the rest of the URL parsing in Libravatar. I wish I had unit tests for that file, mod_rewrite rules are easy to mess up :(

Revision history for this message
Miro Hrončok (churchyard) wrote :

Hi, has there been any progress?

Changed in libravatar:
assignee: François Marier (fmarier) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.