Commit 07357c6d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch...

Merge branch '10248-npm-packages-with-a-dot-on-the-package-name-returns-403-when-trying-to-install' into 'master'

Fix NPM package install with a dot in the name

Closes #10248

See merge request gitlab-org/gitlab-ee!9900
parents 4ed167b4 211e8105
---
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