Comment 26 for bug 703807

Revision history for this message
William Grant (wgrant) wrote :

From twisted.web.static.File.render_GET:

        if request.setLastModified(self.getmtime()) is http.CACHED:
            return ''

        producer = self.makeProducer(request, fileForReading)

makeProducer calls _setContentHeaders, which sets Content-Type. This is conveniently skipped when returning a 304.

But RFC2616 says:

    If a cache uses a received 304 response to update a cache entry, the
    cache MUST update the entry to reflect any new field values given in
    the response.

So twisted.web should really always be returning the correctly Content-Type.