From 1988bbf70bb650f2f9cb4bd9f94c88b10c0e6dc3 Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Fri, 3 May 2024 01:39:05 -0500 Subject: [PATCH] "Allow" double versioning --- app/controllers/yiff_rest/api_v2_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yiff_rest/api_v2_controller.rb b/app/controllers/yiff_rest/api_v2_controller.rb index 7f64ae1..84399a7 100644 --- a/app/controllers/yiff_rest/api_v2_controller.rb +++ b/app/controllers/yiff_rest/api_v2_controller.rb @@ -12,6 +12,7 @@ module YiffRest return render_error(YiffyAPIErrorCodes::IMAGES_IMAGE_RESPONSE_DISABLED, error: "Image response has been disabled. Please use the json response.") if params[:category].ends_with?("/image") category = params[:category]&.downcase&.gsub("/", ".") || "" + category = category[3..] if category.start_with?("v2.") return redirect_to("https://yiff.rest") if category.blank? limit = params[:amount]&.to_i || 1