Skip to content

Commit

Permalink
http: set default to 1.1
Browse files Browse the repository at this point in the history
Change-Id: Ie254545e10e0c91bc5f56615c60ad1c5fafdd1d5
  • Loading branch information
SoloJacobs committed Feb 11, 2025
1 parent 58ac0b5 commit 3313a69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmk/update_config/http/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def _migrate_url_params(
return (
{
**method, # TODO: Proxy sets this to CONNECT.
"http_versions": "http_1_1", # TODO: This preserves behaviour, v1 only allows for HTTP/1.1. or HTTP/1.0.
# However, for most customers this still might be undesirable.
**tls_versions,
**timeout,
**user_agent,
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/cmk/update_config/http/test_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,3 +1464,13 @@ def test_migrate_address_family(rule_value: Mapping[str, object], expected: obje
# Assert
assert ssc_value[0].settings.connection is not None
assert ssc_value[0].settings.connection.address_family == expected


def test_preserve_http_version() -> None:
# Act
migrated = migrate(EXAMPLE_27)
# Assemble
ssc_value = parse_http_params(process_configuration_to_parameters(migrated).value)
# Assert
assert ssc_value[0].settings.connection is not None
assert ssc_value[0].settings.connection.http_versions == "http_1_1"

0 comments on commit 3313a69

Please sign in to comment.