Mercurial > prosody-hg
comparison plugins/mod_http_files.lua @ 10776:8f3b87eaec49 0.11
mod_http_files: Avoid using inode in etag, fix #1498
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 25 Apr 2020 20:55:00 +0200 |
| parents | f7530c846f98 |
| children | a62b981db0e2 |
comparison
equal
deleted
inserted
replaced
| 10756:a026e4f45f3f | 10776:8f3b87eaec49 |
|---|---|
| 110 local request_headers, response_headers = request.headers, response.headers; | 110 local request_headers, response_headers = request.headers, response.headers; |
| 111 | 111 |
| 112 local last_modified = os_date('!%a, %d %b %Y %H:%M:%S GMT', attr.modification); | 112 local last_modified = os_date('!%a, %d %b %Y %H:%M:%S GMT', attr.modification); |
| 113 response_headers.last_modified = last_modified; | 113 response_headers.last_modified = last_modified; |
| 114 | 114 |
| 115 local etag = ('"%02x-%x-%x-%x"'):format(attr.dev or 0, attr.ino or 0, attr.size or 0, attr.modification or 0); | 115 local etag = ('"%x-%x-%x"'):format(attr.change or 0, attr.size or 0, attr.modification or 0); |
| 116 response_headers.etag = etag; | 116 response_headers.etag = etag; |
| 117 | 117 |
| 118 local if_none_match = request_headers.if_none_match | 118 local if_none_match = request_headers.if_none_match |
| 119 local if_modified_since = request_headers.if_modified_since; | 119 local if_modified_since = request_headers.if_modified_since; |
| 120 if etag == if_none_match | 120 if etag == if_none_match |
