diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-06 13:21:42 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-06 13:23:12 +0300 |
commit | 639c93b4f2bd492a214065b5fdc47da2f5d8614d (patch) | |
tree | 45204e566c7114668821ef920ba9989efe17b586 | |
parent | 0a9cab4ee65f2b42c56989698c401cab60d68b53 (diff) |
Don't have Markdown preview fail for long content by using POST rather than GET.
See https://github.com/gitlabhq/gitlabhq/issues/8611.
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/assets/javascripts/dropzone_input.js.coffee | 2 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | spec/routing/project_routing_spec.rb | 4 |
4 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG index 235a99b4327..ed7375e27ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -61,6 +61,7 @@ v 7.8.0 - - API: Add support for editing an existing project (Mika Mäenpää and Hannes Rosenögger) - + - Don't have Markdown preview fail for long comments/wiki pages. - - When test web hook - show error message instead of 500 error page if connection to hook url was reset - Added support for firing system hooks on group create/destroy and adding/removing users to group (Boyan Tabakov) diff --git a/app/assets/javascripts/dropzone_input.js.coffee b/app/assets/javascripts/dropzone_input.js.coffee index abb5bf519ee..d98d5482937 100644 --- a/app/assets/javascripts/dropzone_input.js.coffee +++ b/app/assets/javascripts/dropzone_input.js.coffee @@ -50,7 +50,7 @@ class @DropzoneInput preview.text "Nothing to preview." else preview.text "Loading..." - $.get($(this).data("url"), + $.post($(this).data("url"), md_text: mdText ).success (previewData) -> preview.html previewData diff --git a/config/routes.rb b/config/routes.rb index f0abd876ecd..66faf5312b4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -209,7 +209,7 @@ Gitlab::Application.routes.draw do post :unarchive post :upload_image post :toggle_star - get :markdown_preview + post :markdown_preview get :autocomplete_sources end diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index e36b266a1ff..b8f9d2bf20a 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -60,7 +60,7 @@ end # project GET /:id(.:format) projects#show # PUT /:id(.:format) projects#update # DELETE /:id(.:format) projects#destroy -# markdown_preview_project GET /:id/markdown_preview(.:format) projects#markdown_preview +# markdown_preview_project POST /:id/markdown_preview(.:format) projects#markdown_preview describe ProjectsController, 'routing' do it 'to #create' do post('/projects').should route_to('projects#create') @@ -91,7 +91,7 @@ describe ProjectsController, 'routing' do end it 'to #markdown_preview' do - get('/gitlab/gitlabhq/markdown_preview').should( + post('/gitlab/gitlabhq/markdown_preview').should( route_to('projects#markdown_preview', id: 'gitlab/gitlabhq') ) end |