comparison roundup/cgi/client.py @ 8186:b938fd5223ae

fix(web): issue2551356. Add etag header ... fix env variable name Changed HTTP_ETAG to HTTP_IF_NONE_MATCH.
author John Rouillard <rouilj@ieee.org>
date Tue, 10 Dec 2024 17:38:57 -0500
parents e84d4585b16d
children 5c506c778893
comparison
equal deleted inserted replaced
8185:e84d4585b16d 8186:b938fd5223ae
2043 # check if available. Skip testing modified data. 2043 # check if available. Skip testing modified data.
2044 if hasattr(self.request, 'headers'): 2044 if hasattr(self.request, 'headers'):
2045 inm = self.request.headers.get('if-none-match') 2045 inm = self.request.headers.get('if-none-match')
2046 elif 'HTTP_IF_NONE_MATCH' in self.env: 2046 elif 'HTTP_IF_NONE_MATCH' in self.env:
2047 # maybe the cgi will put the header in the env var 2047 # maybe the cgi will put the header in the env var
2048 inm = self.env['HTTP_ETAG'] 2048 inm = self.env['HTTP_IF_NONE_MATCH']
2049 if inm and etag == inm: 2049 if inm and etag == inm:
2050 # because we can compress, always set Accept-Encoding 2050 # because we can compress, always set Accept-Encoding
2051 # value. Otherwise caches can serve up the wrong info 2051 # value. Otherwise caches can serve up the wrong info
2052 # if their cached copy has no compression. 2052 # if their cached copy has no compression.
2053 self.setVary("Accept-Encoding") 2053 self.setVary("Accept-Encoding")

Roundup Issue Tracker: http://roundup-tracker.org/