Comparison

plugins/mod_http_files.lua @ 7487:88a0a947e58c

mod_http_files: send valid ETag header RFC 2616 section 14 (header field definitions) shows that ETag header content should be wrapped in double quotes.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 09 Jul 2016 21:55:37 +0800
parent 7231:c018a44b822a
child 7490:b75b08af7a78
comparison
equal deleted inserted replaced
7486:c415a3fd4485 7487:88a0a947e58c
107 local request_headers, response_headers = request.headers, response.headers; 107 local request_headers, response_headers = request.headers, response.headers;
108 108
109 local last_modified = os_date('!%a, %d %b %Y %H:%M:%S GMT', attr.modification); 109 local last_modified = os_date('!%a, %d %b %Y %H:%M:%S GMT', attr.modification);
110 response_headers.last_modified = last_modified; 110 response_headers.last_modified = last_modified;
111 111
112 local etag = ("%02x-%x-%x-%x"):format(attr.dev or 0, attr.ino or 0, attr.size or 0, attr.modification or 0); 112 local etag = ('"%02x-%x-%x-%x"'):format(attr.dev or 0, attr.ino or 0, attr.size or 0, attr.modification or 0);
113 response_headers.etag = etag; 113 response_headers.etag = etag;
114 114
115 local if_none_match = request_headers.if_none_match 115 local if_none_match = request_headers.if_none_match
116 local if_modified_since = request_headers.if_modified_since; 116 local if_modified_since = request_headers.if_modified_since;
117 if etag == if_none_match 117 if etag == if_none_match