Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HSTS test #167

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def varstore_dir(self):
return "/var/lib/varstored"

def enable_hsts_header(self):
self.ssh(['echo', '"add_hsts_response_header = true"', '>',
self.ssh(['echo', '"hsts_max_age = 63072000"', '>',
f'{XAPI_CONF_DIR}/00-XCP-ng-tests-enable-hsts-header.conf'])
self.restart_toolstack(verify=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/misc/test_file_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_fileserver_redirect_https(host):
assert lines[2].strip() == "location:https://" + host.hostname_or_ip + path

class TestHSTS:
HSTS_HEADER = "Strict-Transport-Security:max-age=63072000"
HSTS_HEADER = "strict-transport-security:max-age=63072000"

def __get_header(host):
process = subprocess.Popen(
Expand Down
Loading