Skip to content
Snippets Groups Projects
Commit 4ef8d0ee authored by Per Hedbor's avatar Per Hedbor
Browse files

Support If-None-Match for etags.

parent 73e64e24
No related branches found
No related tags found
No related merge requests found
...@@ -634,7 +634,6 @@ void response_and_finish(mapping m, function|void _log_cb) ...@@ -634,7 +634,6 @@ void response_and_finish(mapping m, function|void _log_cb)
if (request_headers["if-modified-since"]) if (request_headers["if-modified-since"])
{ {
int t = .http_decode_date(request_headers["if-modified-since"]); int t = .http_decode_date(request_headers["if-modified-since"]);
if (t) if (t)
{ {
if (!m->stat && m->file) if (!m->stat && m->file)
...@@ -648,6 +647,23 @@ void response_and_finish(mapping m, function|void _log_cb) ...@@ -648,6 +647,23 @@ void response_and_finish(mapping m, function|void _log_cb)
} }
} }
if (request_headers["if-none-match"] && m->extra_heads )
{
string et;
if((et = m->extra_heads->ETag) || (et =m->extra_heads->etag))
{
if( string key = request_headers["if-none-match"] )
{
if (key == et)
{
m_delete(m,"file");
m->data="";
m->error=304;
}
}
}
}
string header=make_response_header(m); string header=make_response_header(m);
if (m->stop) m->size=1+m->stop-m->start; if (m->stop) m->size=1+m->stop-m->start;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment