Skip to content

Commit 7a3d9c9

Browse files
authored
Nothing comparison improvement (#741)
* improve nothing comparison * rollback not nothing comarison
1 parent 11bcccc commit 7a3d9c9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/download.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function try_get_filename_from_headers(resp)
2222
# extract out of Content-Disposition line
2323
# rough version of what is needed in https://github.com/JuliaWeb/HTTP.jl/issues/179
2424
filename_part = match(r"filename\s*=\s*(.*)", content_disp)
25-
if filename_part != nothing
25+
if filename_part !== nothing
2626
filename = filename_part[1]
2727
quoted_filename = match(r"\"(.*)\"", filename)
28-
if quoted_filename != nothing
28+
if quoted_filename !== nothing
2929
# It was in quotes, so it will be double escaped
3030
filename = unescape_string(quoted_filename[1])
3131
end

test/utils.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ import HTTP.URIs
3737
end
3838

3939
withenv("HTTPS_PROXY"=>nothing, "https_proxy"=>nothing) do
40-
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == nothing
40+
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") === nothing
4141
end
4242
withenv("HTTPS_PROXY"=>"") do
4343
# to be compatible with Julia 1.0
44-
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == nothing
44+
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") === nothing
4545
end
4646
withenv("https_proxy"=>"") do
47-
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == nothing
47+
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") === nothing
4848
end
4949
withenv("HTTPS_PROXY"=>"https://user:pass@server:80") do
5050
@test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == "https://user:pass@server:80"
@@ -54,13 +54,13 @@ import HTTP.URIs
5454
end
5555

5656
withenv("HTTP_PROXY"=>nothing, "http_proxy"=>nothing) do
57-
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == nothing
57+
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") === nothing
5858
end
5959
withenv("HTTP_PROXY"=>"") do
60-
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == nothing
60+
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") === nothing
6161
end
6262
withenv("http_proxy"=>"") do
63-
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == nothing
63+
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") === nothing
6464
end
6565
withenv("HTTP_PROXY"=>"http://user:pass@server:80") do
6666
@test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == "http://user:pass@server:80"

0 commit comments

Comments
 (0)