=== 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 or if_match) |
| | 78 | try: |
| | 79 | etags = parse_etags(if_none_match or if_match) |
| | 80 | except ValueError: |
| | 81 | # In case of invalid etag ignore all etag headers |
| | 82 | if_none_match = None |
| | 83 | if_match = None |
| 79 | 84 | |
| 80 | 85 | # Compute values (if any) for the requested resource. |
| 81 | 86 | if etag_func: |
=== modified file 'tests/regressiontests/conditional_processing/models.py'
|
|
|
|
| 112 | 112 | response = self.client.get('/condition/last_modified2/') |
| 113 | 113 | self.assertFullResponse(response, check_etag=False) |
| 114 | 114 | |
| | 115 | def testInvalidETag(self): |
| | 116 | self.client.defaults['HTTP_IF_NONE_MATCH'] = '"\\"' |
| | 117 | response = self.client.get('/condition/etag/') |
| | 118 | self.assertFullResponse(response, check_last_modified=False) |
| | 119 | |
| 115 | 120 | |
| 116 | 121 | class ETagProcesing(TestCase): |
| 117 | 122 | def testParsing(self): |