diff --git a/config/routes/api.rb b/config/routes/api.rb index 08e67ab87b..4ce4751c4d 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -18,8 +18,8 @@ namespace :api, format: false do # foreign custom emojis are encoded as shortcode@domain.tld # the constraint prevents rails from interpreting the ".tld" as a filename extension - post '/react/:id', to: 'reactions#create', constraints: { id: /[^\/]+/ } - post '/unreact/:id', to: 'reactions#destroy', constraints: { id: /[^\/]+/ } + post '/react/:id', to: 'reactions#create', constraints: { id: %r{[^/]+} } + post '/unreact/:id', to: 'reactions#destroy', constraints: { id: %r{[^/]+} } resource :bookmark, only: :create post :unbookmark, to: 'bookmarks#destroy'