Opened 8 years ago

Closed 8 years ago

#1320 closed defect (duplicate)

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

Reported by: tag@… Owned by: datenimperator
Priority: normal Component: GoogleSitemapPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10


Submits incorrect URL.

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

Index: sitemap/
--- sitemap/      (revision 17)
+++ sitemap/      (working copy)
@@ -155,7 +155,7 @@
         """Ping Google sitemaps to indicate that an updated sitemap is available"""
         href = Href(self.env.abs_href)
         url = '' + \
-              urlencode({'sitemap' : href})
+              urlencode({"sitemap" : ""})'Sending ping to Google: %s ' % 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.

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by datenimperator

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.

Can you provide more information regarding the setup of your trac instance?

comment:2 Changed 8 years ago by datenimperator

  • Resolution set to duplicate
  • Status changed from new to closed

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

Add Comment

Modify Ticket

as closed The owner will remain datenimperator.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.