Opened 11 years ago

Closed 11 years ago

When pings are sent, a completely invalid URL is supplied resulting in a leve 400 error.

Reported by: Owned by: tag@… Christian Aust normal GoogleSitemapPlugin normal 0.10

Description

Submits incorrect URL.

I had to add the following patch to get it working on my local setup

Index: sitemap/api.py
===================================================================
--- sitemap/api.py      (revision 17)
+++ sitemap/api.py      (working copy)
@@ -155,7 +155,7 @@
"""Ping Google sitemaps to indicate that an updated sitemap is available"""
href = Href(self.env.abs_href)
-              urlencode({'sitemap' : href})
+              urlencode({"sitemap" : "http://www.blisted.org/sitemap.xml"})
self.env.log.info('Sending ping to Google: %s ' % url)
urllib2.urlopen(url)


I didn't take the time to figure out why the value coming from self.env.abs_href is invalid, but I couldn't also find where self.env is actually defied (granted I know next to nothing about the trac component API).

However, there is obviously a bug here.

comment:1 Changed 11 years ago by Christian Aust

The object instance self.env is created for every request, and considers the current URL that was used when you made the request on the admin interface. Given that your trac might use different URLs at that time, self.env.href makes wrong assumptions. This is currently being discussed on the trac-dev mailing list.

comment:2 Changed 11 years ago by Christian Aust

Resolution: → duplicate new → closed

Implemented a configurable option to store the base url, this should fix it as well. So far, duplicate of #1009

Modify Ticket

Change Properties