Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove internal URIs module and depend on URIs.jl instead #616

Merged
merged 1 commit into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
IniFile = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"

[compat]
IniFile = "0.5"
MbedTLS = "0.6.8, 0.7, 1"
URIs = "1"
julia = "0.7, 1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/AWS4AuthRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using ..Base64
using ..Dates
using MbedTLS: digest, MD_SHA256, MD_MD5
import ..Layer, ..request, ..Headers
using ..URIs
using URIs
using ..Pairs: getkv, setkv, rmkv
import ..@debug, ..DEBUG_LEVEL

Expand Down
2 changes: 1 addition & 1 deletion src/BasicAuthRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module BasicAuthRequest
using ..Base64

import ..Layer, ..request
using ..URIs
using URIs
using ..Pairs: getkv, setkv
import ..@debug, ..DEBUG_LEVEL

Expand Down
2 changes: 1 addition & 1 deletion src/ConnectionRequest.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ConnectionRequest

import ..Layer, ..request
using ..URIs, ..Sockets
using URIs, ..Sockets
using ..Messages
using ..IOExtras
using ..ConnectionPool
Expand Down
2 changes: 1 addition & 1 deletion src/ContentTypeRequest.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ContentTypeDetection

import ..Layer, ..request
using ..URIs
using URIs
using ..Pairs: getkv, setkv
import ..sniff
import ..Form
Expand Down
2 changes: 1 addition & 1 deletion src/CookieRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module CookieRequest

import ..Dates
import ..Layer, ..request
using ..URIs
using URIs
using ..Cookies
using ..Pairs: getkv, setkv
import ..@debug, ..DEBUG_LEVEL
Expand Down
3 changes: 1 addition & 2 deletions src/HTTP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ export startwrite, startread, closewrite, closeread, stack, insert, AWS4AuthLaye
const DEBUG_LEVEL = Ref(0)

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

using Base64, Sockets, Dates
using URIs

include("debug.jl")

include("Pairs.jl") ;using .Pairs
include("IOExtras.jl") ;using .IOExtras
include("Strings.jl")
include("URIs.jl") ;using .URIs
include("sniff.jl")
include("multipart.jl")
include("Parsers.jl") ;import .Parsers: Headers, Header,
Expand Down
3 changes: 2 additions & 1 deletion src/Handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ export serve, Handler, handle, RequestHandlerFunction, StreamHandlerFunction,
RequestHandler, StreamHandler,
Router, @register, register!

using ..Messages, ..URIs, ..Streams, ..IOExtras, ..Servers, ..Sockets
using URIs
using ..Messages, ..Streams, ..IOExtras, ..Servers, ..Sockets

"""
HTTP.handle(handler::HTTP.RequestHandler, ::HTTP.Request) => HTTP.Response
Expand Down
11 changes: 9 additions & 2 deletions src/MessageRequest.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
module MessageRequest

export body_is_a_stream, body_was_streamed, setuseragent!
export body_is_a_stream, body_was_streamed, setuseragent!, resource


import ..Layer, ..request
using ..IOExtras
using ..URIs
using URIs
using ..Messages
import ..Messages: bodylength
import ..Headers
import ..Form, ..content_type

"""
"request-target" per https://tools.ietf.org/html/rfc7230#section-5.3
"""
resource(uri::URI) = string( isempty(uri.path) ? "/" : uri.path,
!isempty(uri.query) ? "?" : "", uri.query,
!isempty(uri.fragment) ? "#" : "", uri.fragment)

"""
request(MessageLayer, method, ::URI, headers, body) -> HTTP.Response

Expand Down
2 changes: 1 addition & 1 deletion src/RedirectRequest.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RedirectRequest

import ..Layer, ..request
using ..URIs
using URIs
using ..Messages
using ..Pairs: setkv
import ..Header
Expand Down
Loading