From 7a3d9c97e4cf9d171babdb818615507b2630cfbc Mon Sep 17 00:00:00 2001 From: Atsushi Sakai Date: Sat, 14 Aug 2021 01:47:49 +0900 Subject: [PATCH] Nothing comparison improvement (#741) * improve nothing comparison * rollback not nothing comarison --- src/download.jl | 4 ++-- test/utils.jl | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/download.jl b/src/download.jl index 77e250bc8..f75be9969 100644 --- a/src/download.jl +++ b/src/download.jl @@ -22,10 +22,10 @@ function try_get_filename_from_headers(resp) # extract out of Content-Disposition line # rough version of what is needed in https://github.com/JuliaWeb/HTTP.jl/issues/179 filename_part = match(r"filename\s*=\s*(.*)", content_disp) - if filename_part != nothing + if filename_part !== nothing filename = filename_part[1] quoted_filename = match(r"\"(.*)\"", filename) - if quoted_filename != nothing + if quoted_filename !== nothing # It was in quotes, so it will be double escaped filename = unescape_string(quoted_filename[1]) end diff --git a/test/utils.jl b/test/utils.jl index 80f7211e5..1c846216f 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -37,14 +37,14 @@ import HTTP.URIs end withenv("HTTPS_PROXY"=>nothing, "https_proxy"=>nothing) do - @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == nothing + @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") === nothing end withenv("HTTPS_PROXY"=>"") do # to be compatible with Julia 1.0 - @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == nothing + @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") === nothing end withenv("https_proxy"=>"") do - @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == nothing + @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") === nothing end withenv("HTTPS_PROXY"=>"https://user:pass@server:80") do @test HTTP.ConnectionRequest.getproxy("https", "https://julialang.org/") == "https://user:pass@server:80" @@ -54,13 +54,13 @@ import HTTP.URIs end withenv("HTTP_PROXY"=>nothing, "http_proxy"=>nothing) do - @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == nothing + @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") === nothing end withenv("HTTP_PROXY"=>"") do - @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == nothing + @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") === nothing end withenv("http_proxy"=>"") do - @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == nothing + @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") === nothing end withenv("HTTP_PROXY"=>"http://user:pass@server:80") do @test HTTP.ConnectionRequest.getproxy("http", "http://julialang.org/") == "http://user:pass@server:80"