Skip to content

Commit b0bf83a

Browse files
author
Ryan Patrick Kyle
committed
🙈 roll new code into try/catch
1 parent 832a717 commit b0bf83a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/handlers.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,13 @@ end
7979

8080
function process_assets(app::DashApp, path, compress::Bool)
8181
assets_path = "$(app.config.routes_pathname_prefix)" * strip(app.config.assets_url_path, '/') * "/"
82-
83-
filename = joinpath(app.config.assets_folder, replace(path, assets_path=>""))
84-
file_contents = read(filename)
85-
mimetype = HTTP.sniff(file_contents)
86-
headers = ["Content-Type" => mimetype]
87-
88-
use_gzip = compress && occursin(r"text|javascript", mimetype)
82+
filename = joinpath(app.config.assets_folder, replace(path, assets_path=>""))
8983

9084
try
85+
file_contents = read(filename)
86+
mimetype = HTTP.sniff(file_contents)
87+
use_gzip = compress && occursin(r"text|javascript", mimetype)
88+
headers = ["Content-Type" => mimetype]
9189
return make_response(200, headers, file_contents, use_gzip)
9290
catch
9391
return HTTP.Response(404)

0 commit comments

Comments
 (0)