Skip to content

Old HTTP interface is broken in 1.1.0

The old HTTPConnection interface, still used by GWpy, is broken as of %GWDataFind 1.1.0:

$ python -c "from gwdatafind.http import HTTPSConnection; conn = HTTPSConnection('datafind.ligo.org', port=443); print(conn.ping())"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/duncan/opt/mambaforge/envs/py310/lib/python3.10/site-packages/gwdatafind/http.py", line 176, in ping
    self._request_response("HEAD", api.ping_path())
  File "/home/duncan/opt/mambaforge/envs/py310/lib/python3.10/site-packages/gwdatafind/http.py", line 97, in _request_response
    raise HTTPError(url, response.status, response.reason,
urllib.error.HTTPError: HTTP Error 400: Bad Request

The server reports for this request:

[Mon May 09 08:49:22.329498 2022] [core:error] [pid 81803] [client 82.31.185.170:49198] AH00126: Invalid URI in request HEAD LDR/services/data/v1/gwf/H/R/1,2 HTTP/1.1

which shows that the requested path is missing the leading /.