Skip to content

Commit 7642ffc

Browse files
author
dsamaey
committed
Issue #747 use job connection for head request
1 parent 446edb0 commit 7642ffc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openeo/rest/_connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def head(
210210
:param auth: optional custom authentication to use instead of the default one
211211
:return: response: Response
212212
"""
213-
return self.request("get", path=path, params=params, auth=auth, **kwargs)
213+
return self.request("head", path=path, params=params, auth=auth, **kwargs)
214214

215215
def post(self, path: str, json: Optional[dict] = None, **kwargs) -> Response:
216216
"""

openeo/rest/job.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def load_bytes(self) -> bytes:
423423

424424

425425
def _download_to_file(self, url: str, target: Path, chunk_size: int):
426-
head = requests.head(url, stream=True)
426+
head = self.job.connection.head(url, stream=True)
427427
if head.ok and 'Accept-Ranges' in head.headers and 'bytes' in head.headers['Accept-Ranges']:
428428
file_size = int(head.headers['Content-Length'])
429429
self._download_chunked(url=url, target=target, file_size=file_size, chunk_size=chunk_size)

0 commit comments

Comments
 (0)