22 lines
514 B
Ruby
22 lines
514 B
Ruby
# typed: true
|
|
class UserScriptsController < ApplicationController
|
|
skip_before_action :authenticate_user!, only: [:get]
|
|
|
|
def get
|
|
expires_in 1.hour, public: true
|
|
response.cache_control[:public] = false
|
|
response.cache_control[:private] = true
|
|
|
|
script = params[:script]
|
|
case script
|
|
when "furecs.user.js"
|
|
send_file(
|
|
Rails.root.join("user_scripts/furecs.user.js"),
|
|
type: "application/json",
|
|
)
|
|
else
|
|
render status: 404, text: "not found"
|
|
end
|
|
end
|
|
end
|