5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-05 07:15:47 +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 # Gestiona las versiones privadas de los sitios. Solo se puede acceder
# con una cuenta # con una cuenta
class PrivateController < ApplicationController class PrivateController < ApplicationController
@ -18,7 +20,7 @@ class PrivateController < ApplicationController
return return
end end
if deploy_private if deploy_private && File.exist?(path)
send_file path, disposition: 'inline' send_file path, disposition: 'inline'
else else
head :not_found head :not_found
@ -69,7 +71,7 @@ class PrivateController < ApplicationController
'index.html' 'index.html'
else else
'.' + params[:format].to_s '.' + params[:format].to_s
end end
@file = @file.gsub('..', '/').gsub('./', '').squeeze('/') @file = @file.gsub('..', '/').gsub('./', '').squeeze('/')
end end