Ticket #7936: syndication-lastmodified.diff

File syndication-lastmodified.diff, 813 bytes (added by Julian Bez, 16 years ago)
  • django/contrib/syndication/views.py

     
    11from django.contrib.syndication import feeds
    22from django.http import HttpResponse, Http404
     3from django.utils.http import http_date
     4import time
    35
    46def feed(request, url, feed_dict=None):
    57    if not feed_dict:
     
    2123        raise Http404, "Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not." % slug
    2224
    2325    response = HttpResponse(mimetype=feedgen.mime_type)
     26    response['Last-Modified'] = http_date(time.mktime(feedgen.latest_post_date().timetuple()))
    2427    feedgen.write(response, 'utf-8')
    2528    return response
Back to Top