def makeTextRequest(count, url, cookie_required): """ Create a request with the count with a 200 status and give cookie back """ response = make_response(str(count), 200) if cookie_required: response.set_cookie(url, utils.getCookieValueToSet(), expires=utils.getExpiration()) return response
def makeSVGRequest(count, url, cookie_required): sizes = utils.calculateSVGSizes(count) svg = utils.getSVG(count, sizes['width'], sizes['recWidth'], sizes['textX'], url).encode('utf-8') response = make_response(svg, 200) response.content_type = 'image/svg+xml' if cookie_required: response.set_cookie(url, utils.getCookieValueToSet(), expires=utils.getExpiration()) return response