From b7c8c121c88dcbc41b76db238219b4d1deb82cd0 Mon Sep 17 00:00:00 2001 From: Justin Sabelko Date: Fri, 22 Dec 2023 14:17:03 -0600 Subject: [PATCH 1/2] Appease standard --- config/initializers/mime_types.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 6233e74..42a10ec 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -3,4 +3,4 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -Mime::Type.register "text/javascript", :mjs, %w( application/javascript application/x-javascript ) +Mime::Type.register "text/javascript", :mjs, %w[application/javascript application/x-javascript] From 5b1ece9cfd1b53ebfd52a8cfb709fe8c79a139f0 Mon Sep 17 00:00:00 2001 From: Justin Sabelko Date: Fri, 22 Dec 2023 14:23:51 -0600 Subject: [PATCH 2/2] Have to define mime-type for Rack if in public folder --- config/initializers/mime_types.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 42a10ec..7219fad 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -3,4 +3,4 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -Mime::Type.register "text/javascript", :mjs, %w[application/javascript application/x-javascript] +Rack::Mime::MIME_TYPES[".mjs"] = "text/javascript"