-
Notifications
You must be signed in to change notification settings - Fork 673
Closed
Description
Description of the problem, including code/CLI snippet
Attempting to use a HEAD request to retrieve file metadata from a project repository (Gitlab REST API docs) fails with a 404
dest_file_get_args = {
'file_path': file_def['dest_filepath'],
'ref': 'HEAD',
}
existing_file = project.files.head(**dest_file_get_args)
Expected Behavior
Should return 200 and file metadata. The same request as a GET request returns 200, and they follow the same URL path and parameter requirements. Sending a GET request logs this URL path:
DEBUG:urllib3.connectionpool:https://gitlab.com:443 "GET /api/v4/projects/1/repository/files/somefile.txt?ref=HEAD HTTP/11" 200 418
Actual Behavior
A HTTP HEAD request is sent with the following URL path:
DEBUG:urllib3.connectionpool:https://gitlab.com:443 "HEAD /api/v4/projects/1/repository/files?file_path=somefile.txt&ref=HEAD HTTP/11" 404 0
Specifications
- python-gitlab version:
3.1.434.9.0 - API version you are using (v3/v4): v4
- Gitlab server version (or gitlab.com): v16.7.4-ee
Metadata
Metadata
Assignees
Labels
No labels