diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2019-01-15 08:59:17 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-01-15 09:02:00 +0100 |
commit | 96a49c79aa16e2d67063474a6a63920346542da4 (patch) | |
tree | 2c1b2fe6e29835ac34397a37b8353fa9438f1b3b /lib/api/wikis.rb | |
parent | 2abbfda301cdb6f1360800b5db203b10debeaffa (diff) | |
download | gitlab-ce-96a49c79aa16e2d67063474a6a63920346542da4.tar.gz |
API: Support dots in wiki slugs
Diffstat (limited to 'lib/api/wikis.rb')
-rw-r--r-- | lib/api/wikis.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/wikis.rb b/lib/api/wikis.rb index 302b2797a34..ef0e3decc2c 100644 --- a/lib/api/wikis.rb +++ b/lib/api/wikis.rb @@ -22,7 +22,9 @@ module API end end - resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + WIKI_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(slug: API::NO_SLASH_URL_PART_REGEX) + + resource :projects, requirements: WIKI_ENDPOINT_REQUIREMENTS do desc 'Get a list of wiki pages' do success Entities::WikiPageBasic end @@ -103,7 +105,7 @@ module API requires :file, type: ::API::Validations::Types::SafeFile, desc: 'The attachment file to be uploaded' optional :branch, type: String, desc: 'The name of the branch' end - post ":id/wikis/attachments", requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + post ":id/wikis/attachments" do authorize! :create_wiki, user_project result = ::Wikis::CreateAttachmentService.new(user_project, |