=== modified file 'django/views/decorators/http.py'
|
|
|
75 | 75 | if if_none_match or if_match: |
76 | 76 | # There can be more than one ETag in the request, so we |
77 | 77 | # consider the list of values. |
78 | | etags = parse_etags(if_none_match) |
| 78 | etags = parse_etags(if_none_match or if_match) |
79 | 79 | |
80 | 80 | # Compute values (if any) for the requested resource. |
81 | 81 | if etag_func: |
=== modified file 'tests/regressiontests/conditional_processing/models.py'
|
|
|
50 | 50 | response = self.client.get('/condition/') |
51 | 51 | self.assertNotModified(response) |
52 | 52 | |
| 53 | def testIfMatch(self): |
| 54 | self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % ETAG |
| 55 | response = self.client.put('/condition/etag/', {'data': ''}) |
| 56 | self.assertEquals(response.status_code, 200) |
| 57 | self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % EXPIRED_ETAG |
| 58 | response = self.client.put('/condition/etag/', {'data': ''}) |
| 59 | self.assertEquals(response.status_code, 412) |
| 60 | |
53 | 61 | def testBothHeaders(self): |
54 | 62 | self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR |
55 | 63 | self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG |