Skip to content

Commit 550f4b1

Browse files
authored
Merge pull request #69 from JuliaWeb/tan/misc
julia 1.0 compatibility
2 parents e61c2c8 + f170878 commit 550f4b1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ os:
55
julia:
66
- 0.6
77
- 0.7
8+
- 1.0
89
- nightly
910
matrix:
1011
fast_finish: true

src/http_rpc_server.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function parsepostdata(req, data_dict, multipart_boundary)
5959
Lbound = length(boundary)
6060
Ldata = length(data)
6161

62-
boundbytes = convert(Vector{UInt8}, boundary)
63-
boundbytes_end = convert(Vector{UInt8}, boundary_end)
62+
boundbytes = convert(Vector{UInt8}, codeunits(boundary))
63+
boundbytes_end = convert(Vector{UInt8}, codeunits(boundary_end))
6464

6565
boundloc = searcharr(data, boundbytes, 1)
6666
endpos = startpos = last(boundloc) + 1
@@ -162,27 +162,27 @@ function http_handler(apis::Channel{APIInvoker{T,F}}, preproc::Function, req::HT
162162
res = HTTP.Response(500)
163163

164164
try
165-
comps = split(getfield(req, :target), '?', limit=2, keep=false)
165+
comps = Compat.split(getfield(req, :target), '?', limit=2, keepempty=false)
166166
if isempty(comps)
167167
res = HTTP.Response(404)
168168
else
169169
res = preproc(req)
170170
if res === nothing
171-
comps = split(getfield(req, :target), '?', limit=2, keep=false)
172-
path = shift!(comps)
171+
comps = Compat.split(getfield(req, :target), '?', limit=2, keepempty=false)
172+
path = popfirst!(comps)
173173
data_dict = isempty(comps) ? Dict{String,String}() : HTTP.queryparams(comps[1])
174174
multipart_boundary = get_multipart_form_boundary(req)
175175
if multipart_boundary === nothing
176176
data_dict = parsepostdata(req, data_dict)
177177
else
178178
data_dict = parsepostdata(req, data_dict, multipart_boundary)
179179
end
180-
args = map(String, split(path, '/', keep=false))
180+
args = map(String, Compat.split(path, '/', keepempty=false))
181181

182182
if isempty(args) || !isvalidcmd(args[1])
183183
res = HTTP.Response(404)
184184
else
185-
cmd = shift!(args)
185+
cmd = popfirst!(args)
186186
@static if isdefined(Base, Symbol("@info"))
187187
@info("waiting for a handler")
188188
else

0 commit comments

Comments
 (0)