diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 05ffdf1cc..a521ff4c5 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -1,2 +1,6 @@ module RepositoriesHelper + def render_decode64_content(str) + return nil if str.blank? + Base64.decode64(str) + end end diff --git a/app/views/repositories/_simple_entry.json.jbuilder b/app/views/repositories/_simple_entry.json.jbuilder index bb3589591..2a3719780 100644 --- a/app/views/repositories/_simple_entry.json.jbuilder +++ b/app/views/repositories/_simple_entry.json.jbuilder @@ -3,5 +3,5 @@ json.sha entry['sha'] json.path entry['path'] json.type entry['type'] json.size entry['size'] -json.content entry['content'] +json.content render_decode64_content(entry['content']) json.target entry['target'] diff --git a/config/routes.rb b/config/routes.rb index 0e8b160b0..38d59cb90 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,7 +86,7 @@ Rails.application.routes.draw do put :change_role end end - + resources :forks, only: [:create] collection do post :migrate get :group_type_list @@ -95,7 +95,6 @@ Rails.application.routes.draw do member do get :branches post :watch - get :fork end end