diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-10-07 13:03:38 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-10-08 19:08:36 +0200 |
commit | 9ab39cd31422636b4678bcea2363f178a7e298d7 (patch) | |
tree | 8e106ca6bfff856d97f82477202666fa83b78355 /src/hydrilla/proxy/policies | |
parent | 6b4de4125e0552292087f443a61518c433981465 (diff) | |
download | haketilo-hydrilla-9ab39cd31422636b4678bcea2363f178a7e298d7.tar.gz haketilo-hydrilla-9ab39cd31422636b4678bcea2363f178a7e298d7.zip |
[builder][server][proxy] make current Haketilo version available to our code as a tuple of integers
Diffstat (limited to 'src/hydrilla/proxy/policies')
-rw-r--r-- | src/hydrilla/proxy/policies/payload_resource.py | 6 |
1 files changed, 2 insertions, 4 deletions
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), |