lib/roda/plugins/public.rb
def public_serve_with(server)
          return unless is_get?
          path = PARSER.unescape(real_remaining_path)
          return if path.include?("\0")

          roda_opts = roda_class.opts
          path = ::File.join(server.root, *public_path_segments(path))

          public_serve_compressed(server, path, '.br', 'br') if roda_opts[:public_brotli]
          public_serve_compressed(server, path, '.gz', 'gzip') if roda_opts[:public_gzip]

          if public_file_readable?(path)
            halt public_serve(server, path)
          end
        end
# Serve files from the public directory if the file exists and this is a GET request.
Serve files from the public directory if the file exists and this is a GET request.
Serve files from the public directory if the file exists and this is a GET request .
def public_serve_with(server)
          return unless is_get?
          path = PARSER.unescape(real_remaining_path)
          return if path.include?("\0")
          roda_opts = roda_class.opts
          path = ::File.join(server.root, *public_path_segments(path))
          public_serve_compressed(server, path, '.br', 'br') if roda_opts[:public_brotli]
          public_serve_compressed(server, path, '.gz', 'gzip') if roda_opts[:public_gzip]
          if public_file_readable?(path)
            halt public_serve(server, path)
          end
        end
def public_serve_with ( server ) return unless is_get? path = PARSER . unescape ( real_remaining_path ) return if path . include? ( "\0" ) roda_opts = roda_class . opts path = :: File . join ( server . root , * public_path_segments ( path ) ) public_serve_compressed ( server , path , '.br' , 'br' ) if roda_opts [ :public_brotli ] public_serve_compressed ( server , path , '.gz' , 'gzip' ) if roda_opts [ :public_gzip ] if public_file_readable? ( path ) halt public_serve ( server , path ) end end
Serve files from the public directory if the file exists and this is a GET request.
Serve files from the public directory if the file exists and this is a GET request .
server