Skip to content

Commit ea11175

Browse files
committed
fix value of fn-fdk-version to include the fdk language. format: fdk-python/x.y.z
1 parent ba54192 commit ea11175

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

fdk/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# under the License.
1414

1515
import sys
16+
from fdk import version
1617

1718
ASYNC_IO_READ_BUFFER = 65536
1819
DEFAULT_DEADLINE = 30
@@ -43,6 +44,7 @@
4344
FN_ENFORCED_RESPONSE_CODES = [200, 502, 504]
4445
FN_DEFAULT_RESPONSE_CODE = 200
4546

47+
VERSION_HEADER_VALUE = "fdk-python/" + version.VERSION
4648

4749
# todo: python 3.8 is on its way, make more flexible
4850
def is_py37():

fdk/response.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from fdk import context
1616
from fdk import constants
17-
from fdk import version
1817

1918

2019
class Response(object):
@@ -39,7 +38,7 @@ def __init__(self, ctx: context.InvokeContext,
3938
self.response_data = response_data if response_data else ""
4039
if headers is None:
4140
headers = {}
42-
headers.update({constants.FN_FDK_VERSION: version.VERSION})
41+
headers.update({constants.FN_FDK_VERSION: constants.VERSION_HEADER_VALUE})
4342
ctx.SetResponseHeaders(headers, status_code)
4443
self.ctx = ctx
4544

fdk/tests/test_http_stream.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from fdk import constants
2020
from fdk import event_handler
2121
from fdk import fixtures
22-
from fdk import version
2322

2423
from fdk.tests import funcs
2524

@@ -35,7 +34,7 @@ async def test_override_content_type():
3534
assert headers.get("content-type") == "application/json"
3635
# we've had issues with 'Content-Type: None' slipping in
3736
assert headers.get("Content-Type") is None
38-
assert version.VERSION == headers.get(constants.FN_FDK_VERSION)
37+
assert headers.get(constants.FN_FDK_VERSION) == constants.VERSION_HEADER_VALUE
3938

4039

4140
@pytest.mark.asyncio

0 commit comments

Comments
 (0)