summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-04-01 12:40:59 -0700
committerStan Hu <stanhu@gmail.com>2017-04-02 06:36:37 -0700
commit6811adafd5e98e1c058f6493072a66d74494387f (patch)
treeaf49066cb28a185d17ebefe4fe36898849743ebc
parent9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff)
downloadgitlab-ce-sh-relax-wiki-slug-constraint.tar.gz
Relax constraint on Wiki IDs, since subdirectories can contain spacessh-relax-wiki-slug-constraint
If a subdirectory contains spaces, GitLab would be unable to generate the route in the sidebar, resulting in an Error 500. Closes #30357
-rw-r--r--changelogs/unreleased/sh-relax-wiki-slug-constraint.yml4
-rw-r--r--config/routes/wiki.rb4
2 files changed, 5 insertions, 3 deletions
diff --git a/changelogs/unreleased/sh-relax-wiki-slug-constraint.yml b/changelogs/unreleased/sh-relax-wiki-slug-constraint.yml
new file mode 100644
index 00000000000..08395b0d28c
--- /dev/null
+++ b/changelogs/unreleased/sh-relax-wiki-slug-constraint.yml
@@ -0,0 +1,4 @@
+---
+title: Relax constraint on Wiki IDs, since subdirectories can contain spaces
+merge_request:
+author:
diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb
index a6b3f5d4693..c2da84ff6f2 100644
--- a/config/routes/wiki.rb
+++ b/config/routes/wiki.rb
@@ -1,5 +1,3 @@
-WIKI_SLUG_ID = { id: /\S+/ }.freeze unless defined? WIKI_SLUG_ID
-
scope(controller: :wikis) do
scope(path: 'wikis', as: :wikis) do
get :git_access
@@ -8,7 +6,7 @@ scope(controller: :wikis) do
post '/', to: 'wikis#create'
end
- scope(path: 'wikis/*id', as: :wiki, constraints: WIKI_SLUG_ID, format: false) do
+ scope(path: 'wikis/*id', as: :wiki, format: false) do
get :edit
get :history
post :preview_markdown