Skip to content

Commit

Permalink
use !isnothing(body)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpkyle committed Apr 27, 2020
1 parent b0bf83a commit 08bb621
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function make_handler(app::DashApp; debug::Bool = false)
index_string::String = index_page(app, debug = debug)

return function (req::HTTP.Request)
body::Union{Nothing, String} = nothing
uri = HTTP.URI(req.target)

# verify that the client accepts compression
Expand Down Expand Up @@ -135,9 +136,9 @@ function make_handler(app::DashApp; debug::Bool = false)
end
end
end
if @isdefined body
if !isnothing(body)
return make_response(200, headers, body, with_gzip)
end
return HTTP.Response(404)
end
end
end

0 comments on commit 08bb621

Please sign in to comment.