From 9faf4aeada0492ed68ff200d89c9f160ecb5751c Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 27 May 2026 21:33:40 +0200 Subject: [PATCH] /json/ URL should work with dots in the package name now --- config/routes.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 178585f..fa5401d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -85,11 +85,14 @@ Rails.application.routes.draw do get 'without_screenshots', to: redirect('/packages?show=without') # JSON data responses - get 'json/package/:name' => 'json#package', as: :json_package, defaults: { format: :json } - get 'json/packages' => 'json#packages', as: :json_packages, defaults: { format: :json } - get 'json/screenshots' => 'json#screenshots', as: :json_screenshots, defaults: { format: :json } + get 'json/package/:name' => 'json#package', as: :json_package, defaults: { format: :json }, + name: %r{[^/]+} + get 'json/packages' => 'json#packages', as: :json_packages, defaults: { format: :json }, + name: %r{[^/]+} + get 'json/screenshots' => 'json#screenshots', as: :json_screenshots, + defaults: { format: :json }, name: %r{[^/]+} get 'json/packages-without-screenshots' => 'json#packages_without_screenshots', - defaults: { format: :json } + defaults: { format: :json }, name: %r{[^/]+} # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes".