const char *fmt = "%a, %d %b %Y %H:%M:%S GMT", *msg = "OK";
big_int_t cl; /* Content-Length */
- if (c->mime_type == NULL)
- c->mime_type = get_mime_type(c->ctx, c->uri, strlen(c->uri));
+ if (c->mime_type.len == 0)
+ get_mime_type(c->ctx, c->uri, strlen(c->uri), &c->mime_type);
cl = (big_int_t) stp->st_size;
/* If Range: header specified, act accordingly */
"Date: %s\r\n"
"Last-Modified: %s\r\n"
"Etag: \"%s\"\r\n"
- "Content-Type: %s\r\n"
+ "Content-Type: %.*s\r\n"
"Content-Length: %lu\r\n"
- "Connection: close\r\n"
+ "Accept-Ranges: bytes\r\n"
"%s\r\n",
- status, msg, date, lm, etag, c->mime_type, cl, range);
+ status, msg, date, lm, etag,
+ c->mime_type.len, c->mime_type.ptr, cl, range);
c->status = status;
c->loc.content_len = cl;