Skip to content

Commit

Permalink
Merge 8a549c8 into 04bcf96
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed Feb 6, 2019
2 parents 04bcf96 + 8a549c8 commit a0f8ae1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions datapackage_pipelines/web/server.py
Expand Up @@ -11,7 +11,8 @@
import mistune
import requests

from flask import Blueprint, Flask, render_template, abort, send_file
from flask import \
Blueprint, Flask, render_template, abort, send_file, make_response
from flask_cors import CORS
from flask_jsonpify import jsonify
from flask_basicauth import BasicAuth
Expand Down Expand Up @@ -255,7 +256,11 @@ def _make_badge_response(subject, text, colour):
r = requests.get(image_url)
buffer_image = BytesIO(r.content)
buffer_image.seek(0)
return send_file(buffer_image, mimetype='image/svg+xml')
res = make_response(send_file(buffer_image, mimetype='image/svg+xml'))
res.headers['Cache-Control'] = \
'max-age=0, no-cache, no-store, must-revalidate'
res.headers['Expires'] = '0'
return res


@blueprint.route("badge/<path:pipeline_id>")
Expand Down

0 comments on commit a0f8ae1

Please sign in to comment.