diff options
author | Stan Hu <stanhu@gmail.com> | 2017-04-01 22:40:59 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-04-02 16:36:37 +0300 |
commit | 6811adafd5e98e1c058f6493072a66d74494387f (patch) | |
tree | af49066cb28a185d17ebefe4fe36898849743ebc | |
parent | 9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff) |
Relax constraint on Wiki IDs, since subdirectories can contain spaces
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.yml | 4 | ||||
-rw-r--r-- | config/routes/wiki.rb | 4 |
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 |