Commit 211e8105 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix npm package install with a dot in the name

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4ed167b4
---
title: Fix npm package install with a dot in the name
merge_request: 9900
author:
type: fixed
......@@ -32,7 +32,7 @@ module API
params do
requires :package_name, type: String, desc: 'Package name'
end
get 'packages/npm/*package_name', requirements: NPM_ENDPOINT_REQUIREMENTS do
get 'packages/npm/*package_name', format: false, requirements: NPM_ENDPOINT_REQUIREMENTS do
package_name = params[:package_name]
# To avoid name collision we require project path and project package be the same.
......
......@@ -35,6 +35,16 @@ describe API::NpmPackages do
expect_a_valid_package_response
end
context 'project path with a dot' do
let(:project) { create(:project, :public, namespace: group, path: 'foo.bar') }
it 'returns the package info' do
get_package(package)
expect_a_valid_package_response
end
end
end
context 'internal project' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment