1.1 --- a/actions/SharedUpdates.py Sun Jun 24 21:57:23 2012 +0200
1.2 +++ b/actions/SharedUpdates.py Mon Jun 25 00:20:12 2012 +0200
1.3 @@ -99,11 +99,13 @@
1.4 headers = ["Content-Type: application/atom+xml; charset=%s" % config.charset]
1.5
1.6 # Define the last modified time.
1.7 - # NOTE: We could get edits since a certain time and only process those.
1.8 + # NOTE: We could attempt to get the last edit time of the fragment.
1.9
1.10 page = Page(request, pagename)
1.11 metadata = getMetadata(page)
1.12
1.13 + # NOTE: Consider using request.httpDate.
1.14 +
1.15 if metadata.has_key("last-modified"):
1.16 latest_timestamp = metadata["last-modified"]
1.17 headers.append("Last-Modified: %s" % latest_timestamp.as_HTTP_datetime_string())
1.18 @@ -160,12 +162,16 @@
1.19 else:
1.20 mimetypes = ["text/html"]
1.21
1.22 - # NOTE: Perform content negotiation, obtaining mimetypes common to the
1.23 - # NOTE: fragment and the client.
1.24 + # Perform content negotiation, obtaining mimetypes common to the
1.25 + # fragment and the client.
1.26 +
1.27 + accept = getHeader(request, "Accept", "HTTP")
1.28 + prefs = getContentPreferences(accept)
1.29 + preferred = prefs.get_preferred_types(mimetypes)
1.30
1.31 download_links = []
1.32
1.33 - for mimetype in mimetypes:
1.34 + for mimetype in preferred:
1.35 specific_link = "%s&mimetype=%s" % (fragment_link, mimetype)
1.36
1.37 download_links.append('<link rel="alternate" type="%s" href="%s"/>' % (