Skip to content

Commit

Permalink
Remove format constraint from frontend/static route
Browse files Browse the repository at this point in the history
`format` doesn't accept an array. This currently creates a format constraint that looks like this,
and emits a warning because characters appear multiple times in the character class:
`/\A["css", "js", "svg"]\Z/`

The constraint is actually not needed, the controller already handles this.
  • Loading branch information
Earlopain committed Aug 9, 2024
1 parent 72ba713 commit 0cf4c70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@

scope :frontend, controller: :frontends, defaults: { version: GoodJob::VERSION.tr(".", "-") } do
get "modules/:version/:id", action: :module, as: :frontend_module, constraints: { format: 'js' }
get "static/:version/:id", action: :static, as: :frontend_static, constraints: { format: %w[css js svg] }
get "static/:version/:id", action: :static, as: :frontend_static
end
end

0 comments on commit 0cf4c70

Please sign in to comment.