Skip to content

use of @eval inhibits performance #747

Closed
@vtjnash

Description

@vtjnash

This code should not use @eval, since changing the dispatch table can have poorly-controlled side effects:

HTTP.jl/src/Handlers.jl

Lines 410 to 417 in 209f10e

@eval function HTTP.Handlers.gethandler(r::$(Expr(:$, :(typeof($router)))),
::(HTTP.Handlers.gh($method)),
::(HTTP.Handlers.gh($scheme)),
::(HTTP.Handlers.gh($host)),
$(Expr(:$, vals)),
args...)
return $(Expr(:$, handler)) isa HTTP.Handler ? $(Expr(:$, handler)) : HTTP.Handlers.RequestHandlerFunction($(Expr(:$, handler)))
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverAbout our HTTP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions