web: set cache-control header for the badge endpoint
This change enables displaying the correct badge by forcing the cache to be disabled as recommended by: https://docs.github.com/en/github/authenticating-to-github/about-anonymized-image-urls#an-image-that-changed-recently-is-not-updating Change-Id: I92a831d62a626d2f066f40c3358e19260de8cbdd
This commit is contained in:
parent
8673a6ca6f
commit
86f588e97f
|
@ -1057,6 +1057,9 @@ class ZuulWebAPI(object):
|
||||||
file = 'failing.svg'
|
file = 'failing.svg'
|
||||||
path = os.path.join(self.zuulweb.static_path, file)
|
path = os.path.join(self.zuulweb.static_path, file)
|
||||||
|
|
||||||
|
# Ensure the badge are not cached
|
||||||
|
cherrypy.response.headers['Cache-Control'] = "no-cache"
|
||||||
|
|
||||||
return cherrypy.lib.static.serve_file(
|
return cherrypy.lib.static.serve_file(
|
||||||
path=path, content_type="image/svg+xml")
|
path=path, content_type="image/svg+xml")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue