summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-16 00:14:26 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-16 00:14:26 +0800
commit567ef6c1755c13dfcda1c9cb06b1eb5fbca0ef1b (patch)
tree8871b4bb3d8bd3f56205465273deb8d61b7274c6 /config/routes.rb
parent44b29b5b3b908ee5acd1d35fdf8e75333e7e50c1 (diff)
parent06e3bb9f232329674bdc162dc8f973a19b03f3c4 (diff)
downloadgitlab-ce-567ef6c1755c13dfcda1c9cb06b1eb5fbca0ef1b.tar.gz
Merge remote-tracking branch 'upstream/master' into artifacts-from-ref-and-build-name
* upstream/master: (123 commits) Limit the size of SVGs when viewing them as blobs Add a spec for ProjectsFinder project_ids_relation option Fix ProjectsFinder spec Pass project IDs relation to ProjectsFinder instead of using a block Speed up todos queries by limiting the projects set we join with Used phantomjs variable Ability to specify branches for pivotal tracker integration Fix a memory leak caused by Banzai::Filter::SanitizationFilter Update phantomjs link Remove sleeping and replace escaped text. Filters test fix Fixed filtering tests Removed screenshot command :poop: Updated failing tests Used mirrored version on GitLab Updated tests Fix `U2fSpec` for PhantomJS versions > 2. Fix file downloading Install latest stable phantomjs Use new PhantomJS version ...
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 256c7dacd59..70bdb1d5beb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -84,9 +84,6 @@ Rails.application.routes.draw do
# Health check
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
- # Enable Grack support (for LFS only)
- mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put]
-
# Help
get 'help' => 'help#index'
get 'help/shortcuts' => 'help#shortcuts'
@@ -471,7 +468,7 @@ Rails.application.routes.draw do
post :unarchive
post :housekeeping
post :toggle_star
- post :markdown_preview
+ post :preview_markdown
post :export
post :remove_export
post :generate_new_export
@@ -482,11 +479,26 @@ Rails.application.routes.draw do
end
scope module: :projects do
- # Git HTTP clients ('git clone' etc.)
scope constraints: { id: /.+\.git/, format: nil } do
+ # Git HTTP clients ('git clone' etc.)
get '/info/refs', to: 'git_http#info_refs'
post '/git-upload-pack', to: 'git_http#git_upload_pack'
post '/git-receive-pack', to: 'git_http#git_receive_pack'
+
+ # Git LFS API (metadata)
+ post '/info/lfs/objects/batch', to: 'lfs_api#batch'
+ post '/info/lfs/objects', to: 'lfs_api#deprecated'
+ get '/info/lfs/objects/*oid', to: 'lfs_api#deprecated'
+
+ # GitLab LFS object storage
+ scope constraints: { oid: /[a-f0-9]{64}/ } do
+ get '/gitlab-lfs/objects/*oid', to: 'lfs_storage#download'
+
+ scope constraints: { size: /[0-9]+/ } do
+ put '/gitlab-lfs/objects/*oid/*size/authorize', to: 'lfs_storage#upload_authorize'
+ put '/gitlab-lfs/objects/*oid/*size', to: 'lfs_storage#upload_finalize'
+ end
+ end
end
# Allow /info/refs, /info/refs?service=git-upload-pack, and
@@ -660,7 +672,7 @@ Rails.application.routes.draw do
get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID
delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID
put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID
- post '/wikis/*id/markdown_preview', to: 'wikis#markdown_preview', constraints: WIKI_SLUG_ID, as: 'wiki_markdown_preview'
+ post '/wikis/*id/preview_markdown', to: 'wikis#preview_markdown', constraints: WIKI_SLUG_ID, as: 'wiki_preview_markdown'
end
resource :repository, only: [:create] do