Skip to content

Commit

Permalink
Compat things
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Jun 20, 2024
1 parent caca117 commit b057b50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/HTTP2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mutable struct Request
Request() = new()
end

Base.getproperty(x::Request, s::Symbol) = s == :url ? x.uri : getfield(x, s)
Base.getproperty(x::Request, s::Symbol) = s == :url || s == :target ? x.uri : getfield(x, s)
print_request(io::IO, r::Request) = print_request(io, r.method, r.uri.path, r.headers, r.body)
function Base.show(io::IO, r::Request)
println(io, "HTTP2.Request:")
Expand Down
1 change: 0 additions & 1 deletion src/handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ end

Base.show(io::IO, x::Leaf) = print(io, "Leaf($(x.method))")

export Node
mutable struct Node
segment::Union{String, Variable}
exact::Vector{Node} # sorted alphabetically, all x.segment are String
Expand Down
2 changes: 2 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function setheader(h, k, v)
return
end

setheader(h, p::Pair) = setheader(h, p.first, p.second)

function removeheader(h, k)
i = findfirst(x -> ascii_lc_isequal(x.first, k), h)
i === nothing && return
Expand Down

0 comments on commit b057b50

Please sign in to comment.