Skip to content

Commit

Permalink
Add 'ETag' based on the navigation and content
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Nov 18, 2016
1 parent b2f9990 commit 4b1b459
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/valadoc-app.vala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ namespace Valadoc {
throw new ClientError.NOT_FOUND (""); // ignored in the 404 handler
}

// TODO: Generate 'ETag' header
if (navi_etag != null && content_etag != null) {
var etag = "\"%s\"".printf (navi_etag + content_etag);
if (etag == req.headers.get_one ("If-None-Match")) {
throw new Redirection.NOT_MODIFIED ("");
} else {
res.headers.replace ("ETag", etag);
}
}

return render_template (title.str, (string) navi, (string) content) (req, res, next, ctx);
}));
Expand Down

0 comments on commit 4b1b459

Please sign in to comment.