def keyboard_js(browser_os): from sagenb.notebook.keyboards import get_keyboard data = get_keyboard(browser_os) datahash=sha1(data).hexdigest() if request.environ.get('HTTP_IF_NONE_MATCH', None) == datahash: response = make_response('',304) else: response = make_response(data) response.headers['Content-Type'] = 'text/javascript; charset=utf-8' response.headers['Etag']=datahash return response
def keyboard_js(browser_os): from sagenb.notebook.keyboards import get_keyboard data = get_keyboard(browser_os) datahash = sha1(data).hexdigest() if request.environ.get('HTTP_IF_NONE_MATCH', None) == datahash: response = make_response('', 304) else: response = make_response(data) response.headers['Content-Type'] = 'text/javascript; charset=utf-8' response.headers['Etag'] = datahash return response
def keyboard_js(browser_os): from sagenb.notebook.keyboards import get_keyboard response = make_response(get_keyboard(browser_os)) response.headers['Content-Type'] = 'text/javascript; charset=utf-8' return response