5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 01:36:07 +00:00

no fallar si el sitio todavía no se generó

This commit is contained in:
f 2020-08-29 19:51:56 -03:00
parent 77c16071bd
commit 475c393f46

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Gestiona las versiones privadas de los sitios. Solo se puede acceder
# con una cuenta
class PrivateController < ApplicationController
@ -18,7 +20,7 @@ class PrivateController < ApplicationController
return
end
if deploy_private
if deploy_private && File.exist?(path)
send_file path, disposition: 'inline'
else
head :not_found
@ -69,7 +71,7 @@ class PrivateController < ApplicationController
'index.html'
else
'.' + params[:format].to_s
end
end
@file = @file.gsub('..', '/').gsub('./', '').squeeze('/')
end