fix corner cases in the management of server_hostname (closes #27773)
2 files changed