mirror of
				https://github.com/scinote-eln/scinote-web.git
				synced 2025-11-04 03:59:08 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
	
		
			310 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
	
		
			310 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
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
 |