Skip to content

Commit

Permalink
Merge branch '304fix' of https://github.com/mrj10/webserver into 304fix
Browse files Browse the repository at this point in the history
  • Loading branch information
skinkie committed Apr 6, 2013
2 parents 2b41c2a + acaf26e commit 4163dbb
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions cherokee/handler_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,26 +703,29 @@ cherokee_handler_file_add_headers (cherokee_handler_file_t *fhdl,

/* Last-Modified:
*/
cherokee_gmtime (&fhdl->info->st_mtime, &modified_tm);
if (!(fhdl->not_modified)) {
cherokee_gmtime (&fhdl->info->st_mtime, &modified_tm);

szlen = cherokee_dtm_gmttm2str(bufstr, DTM_SIZE_GMTTM_STR, &modified_tm);
szlen = cherokee_dtm_gmttm2str(bufstr, DTM_SIZE_GMTTM_STR, &modified_tm);

cherokee_buffer_add_str(buffer, "Last-Modified: ");
cherokee_buffer_add (buffer, bufstr, szlen);
cherokee_buffer_add_str(buffer, CRLF);
cherokee_buffer_add_str(buffer, "Last-Modified: ");
cherokee_buffer_add (buffer, bufstr, szlen);
cherokee_buffer_add_str(buffer, CRLF);
}

/* Add MIME related headers:
* "Content-Type:" and "Cache-Control: max-age="
*/
if (fhdl->mime != NULL) {
cuint_t maxage;
cherokee_buffer_t *mime = NULL;

cherokee_mime_entry_get_type (fhdl->mime, &mime);
cherokee_buffer_add_str (buffer, "Content-Type: ");
cherokee_buffer_add_buffer (buffer, mime);
cherokee_buffer_add_str (buffer, CRLF);
if (!(fhdl->not_modified)) {
cherokee_buffer_t *mime = NULL;

cherokee_mime_entry_get_type (fhdl->mime, &mime);
cherokee_buffer_add_str (buffer, "Content-Type: ");
cherokee_buffer_add_buffer (buffer, mime);
cherokee_buffer_add_str (buffer, CRLF);
}
ret = cherokee_mime_entry_get_maxage (fhdl->mime, &maxage);
if (ret == ret_ok) {
/* Set the expiration if there wasn't a
Expand Down

0 comments on commit 4163dbb

Please sign in to comment.