Skip to content

Commit c36e65f

Browse files
committed
Quick hack to work around JuliaLang/julia#25472
1 parent 8afc2c7 commit c36e65f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/URIs.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Base.==
44

55
import ..@require, ..precondition_error
66
import ..@ensure, ..postcondition_error
7+
import ..compat_search
78

89

910
include("urlparser.jl")
@@ -175,10 +176,11 @@ const uses_query = ["http", "wais", "imap", "https", "shttp", "mms", "gopher", "
175176
const uses_fragment = ["hdfs", "ftp", "hdl", "http", "gopher", "news", "nntp", "wais", "https", "shttp", "snews", "file", "prospero"]
176177

177178
"checks if a `HTTP.URI` is valid"
179+
178180
function Base.isvalid(uri::URI)
179181
sch = uri.scheme
180182
isempty(sch) && throw(ArgumentError("can not validate relative URI"))
181-
if ((sch in non_hierarchical) && (search(uri.path, '/') > 1)) || # path hierarchy not allowed
183+
if ((sch in non_hierarchical) && (compat_search(uri.path, '/') > 1)) || # path hierarchy not allowed
182184
(!(sch in uses_query) && !isempty(uri.query)) || # query component not allowed
183185
(!(sch in uses_fragment) && !isempty(uri.fragment)) || # fragment identifier component not allowed
184186
(!(sch in uses_authority) && (!isempty(uri.host) || ("" != uri.port) || !isempty(uri.userinfo))) # authority component not allowed

0 commit comments

Comments
 (0)