From 9ab39cd31422636b4678bcea2363f178a7e298d7 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 7 Oct 2022 13:03:38 +0200 Subject: [builder][server][proxy] make current Haketilo version available to our code as a tuple of integers --- src/hydrilla/proxy/policies/payload_resource.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/hydrilla/proxy') diff --git a/src/hydrilla/proxy/policies/payload_resource.py b/src/hydrilla/proxy/policies/payload_resource.py index 70844e6..7fdc7ac 100644 --- a/src/hydrilla/proxy/policies/payload_resource.py +++ b/src/hydrilla/proxy/policies/payload_resource.py @@ -64,13 +64,12 @@ import json from threading import Lock from base64 import b64encode from urllib.parse import quote, parse_qs, urlparse, urlencode, urljoin -from itertools import takewhile import jinja2 from ...translations import smart_gettext as _ from ...url_patterns import ParsedUrl -from ..._version import version_tuple +from ...versions import haketilo_version from .. import state from .. import http_messages from . import base @@ -281,8 +280,7 @@ class PayloadResourcePolicy(PayloadAwarePolicy): template = jinja_env.get_template('page_init_script.js.jinja') token = self.payload_data.unique_token base_url = self.assets_base_url(request_info.url) - ver = [*takewhile(lambda i: isinstance(i, int), version_tuple)] - ver_str = json.dumps(ver) + ver_str = json.dumps(haketilo_version) js = template.render( unique_token_encoded = encode_string_for_js(token), assets_base_url_encoded = encode_string_for_js(base_url), -- cgit v1.2.3