URL fixes if using unix_socket

- according to https://github.com/ansible/ansible/pull/43560 where
  unix_socket was implemented, you're supposed to use http://localhost/
  as hostname when using unix_socket
This commit is contained in:
Peter Šurda 2024-04-22 15:32:36 +08:00
parent fb178b36cd
commit 00ca2d2133
Signed by untrusted user: PeterSurda
GPG Key ID: 3E47497CF67ABB95

View File

@ -97,7 +97,7 @@ else:
def make_headers(host, api_key, unix_socket=None, device=None): def make_headers(host, api_key, unix_socket=None, device=None):
url = '{}{}{}{}'.format( url = '{}{}{}{}'.format(
host if not unix_socket else "", host,
SYNCTHING_API_URI, SYNCTHING_API_URI,
'/' if device else '', '/' if device else '',
device if device else '') device if device else '')