Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ def v1_ping
end

def v1_search
# Checks for podman client and issues a 404 in that case. Podman
# Checks for v2 client and issues a 404 in that case. Podman
# examines the response from a /v1_search request. If the result
# is a 4XX, it will then proceed with a request to /_catalog
if request.headers['HTTP_USER_AGENT'].downcase.include?('libpod')
if request.headers['HTTP_DOCKER_DISTRIBUTION_API_VERSION'] == 'registry/2.0'
render json: {}, status: :not_found
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def setup_permissions
it "blocks search for podman" do
@docker_repo.set_container_repository_name
@docker_env_repo.set_container_repository_name
@request.env['HTTP_USER_AGENT'] = "libpod/1.8.0"
@request.env['HTTP_DOCKER_DISTRIBUTION_API_VERSION'] = "registry/2.0"
get :v1_search, params: { q: "abc", n: 2 }
assert_response 404
end
Expand Down