Ticket #1172: Generate-a-etag-last-modified-header-for-on-the-fly.patch

File Generate-a-etag-last-modified-header-for-on-the-fly.patch, 1.3 kB (added by stbuehler, 3 months ago)
  • a/src/mod_compress.c

    old new  
    724724                                                } 
    725725                                        } else if (0 == deflate_file_to_buffer(srv, con, p, 
    726726                                                                               con->physical.path, sce, compression_type)) { 
     727                                                buffer *mtime; 
    727728 
    728729                                                response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name)); 
     730 
     731                                                mtime = strftime_cache_get(srv, sce->st.st_mtime); 
     732                                                response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); 
     733 
     734                                                etag_mutate(con->physical.etag, sce->etag); 
     735                                                response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); 
     736 
    729737                                                response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); 
    730738 
    731739                                                return HANDLER_FINISHED;