Skip to content

Commit

Permalink
A few deprecations to ease the new tag (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj authored Jan 25, 2018
1 parent effa302 commit cb50d03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/HTTP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import MbedTLS: SSLContext

const DEBUG_LEVEL = 0

Base.@deprecate escape escapeuri
Base.@deprecate URL URI

include("compat.jl")
include("debug.jl")

Expand All @@ -23,6 +26,7 @@ include("Parsers.jl") ;import .Parsers: Parser, Headers, Header
ParsingError, ByteView
include("ConnectionPool.jl")
include("Messages.jl") ;using .Messages

include("Streams.jl") ;using .Streams


Expand Down Expand Up @@ -578,6 +582,7 @@ include("client.jl")
include("sniff.jl")
include("Handlers.jl") ;using .Handlers
include("Servers.jl") ;using .Servers; using .Servers: listen
Base.@deprecate_binding(Nitrogen, Servers, false)

include("WebSockets.jl") ;using .WebSockets

Expand Down
10 changes: 9 additions & 1 deletion src/Messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Streaming of request and response bodies is handled by the
module Messages

export Message, Request, Response, HeaderSizeError,
reset!,
reset!, status, method, headers, uri, body,
iserror, isredirect, ischunked, issafe, isidempotent,
header, hasheader, setheader, defaultheader, appendheader,
mkheaders, readheaders, headerscomplete, readtrailers, writeheaders,
Expand Down Expand Up @@ -139,6 +139,9 @@ function reset!(r::Response)
end
end

status(r::Response) = r.status
headers(r::Response) = r.headers
body(r::Response) = r.body

"""
Request <: Message
Expand Down Expand Up @@ -197,6 +200,11 @@ Request(bytes) = parse(Request, bytes)
mkheaders(h::Headers) = h
mkheaders(h)::Headers = Header[string(k) => string(v) for (k,v) in h]

method(r::Request) = r.method
uri(r::Request) = r.target
headers(r::Request) = r.headers
body(r::Request) = r.body

"""
issafe(::Request)
Expand Down
2 changes: 2 additions & 0 deletions src/fifobuffer.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module FIFOBuffers

import ..bytesavailable
import ..bytes
using ..IOExtras
import Base.==

Expand Down Expand Up @@ -87,6 +88,7 @@ FIFOBuffer(io::IO) = FIFOBuffer(readavailable(io))
==(a::FIFOBuffer, b::FIFOBuffer) = String(a) == String(b)
Base.length(f::FIFOBuffer) = f.nb
bytesavailable(f::FIFOBuffer) = f.nb
bytes(f::FIFOBuffer) = readavailable(f)
Base.wait(f::FIFOBuffer) = wait(f.cond)
Base.read(f::FIFOBuffer) = readavailable(f)
Base.flush(f::FIFOBuffer) = nothing
Expand Down

0 comments on commit cb50d03

Please sign in to comment.