From 9438bf5cd134f5e9521cc55cf3c80c3d04726fd0 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 6 Nov 2020 11:01:29 +0800 Subject: [PATCH] FIX routes bug --- app/controllers/compare_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/compare_controller.rb b/app/controllers/compare_controller.rb index a67dbd92b..e5e61598e 100644 --- a/app/controllers/compare_controller.rb +++ b/app/controllers/compare_controller.rb @@ -7,7 +7,7 @@ class CompareController < ApplicationController def show base_ref = Addressable::URI.unescape(params[:base]) - @ref = head_ref = Addressable::URI.unescape(params[:head]) + @ref = head_ref = Addressable::URI.unescape(params[:head]&.split('.json')[0]) @compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, base_ref, head_ref) # render json: @compare_result