mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-27 02:16:20 +08:00
495c648f41
Non-wopi routes will only work with the subdomain set by the env variable USER_SUBDOMAIN (if it is set). Likewise, wopi routes will only work with the WOPI_SUBDOMAIN if it is set, but they also require the WOPI_ENABLED to be true.
23 lines
480 B
Ruby
23 lines
480 B
Ruby
class UserSubdomain
|
|
def self.matches?(request)
|
|
if ENV['USER_SUBDOMAIN']
|
|
return request.subdomain.present? && request.subdomain = ENV['USER_SUBDOMAIN']
|
|
else
|
|
return true
|
|
end
|
|
end
|
|
end
|
|
|
|
class WopiSubdomain
|
|
def self.matches?(request)
|
|
if ENV['WOPI_ENABLED'] == "true"
|
|
if ENV['WOPI_SUBDOMAIN']
|
|
return request.subdomain.present? && request.subdomain = ENV['WOPI_SUBDOMAIN']
|
|
else
|
|
return true
|
|
end
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
end |