diff --git a/Project.toml b/Project.toml index 465e65bfa8..31be7999a8 100644 --- a/Project.toml +++ b/Project.toml @@ -29,14 +29,14 @@ ZMQ = "c2297ded-f4af-51ae-bb23-16f91089e4e1" [compat] AutoHashEquals = "0.2" -GitForge = "~0.1.6" +GitForge = "~0.1.8" GitHub = "5.7.0" -HTTP = "0.8, 0.9" +HTTP = "0.8, 0.9, 1" JSON = "0.20, 0.21" MbedTLS = "0.6.8, 0.7, 1" Mocking = "0.7" Mustache = "0.5, 1.0" -Mux = "0.7" +Mux = "0.7, 1" RegistryTools = "1.8" TimeToLive = "0.2, 0.3" ZMQ = "1" diff --git a/src/webui/WebUI.jl b/src/webui/WebUI.jl index 65cd32b079..d15a39b43a 100644 --- a/src/webui/WebUI.jl +++ b/src/webui/WebUI.jl @@ -133,7 +133,7 @@ end error_handler(f::Function, r::HTTP.Request) = try f(r) catch e - @error "Handler error" route=r.target exception=get_backtrace(e) + @error "Handler error" route=r.target exception=(e, catch_backtrace()) html(500, "Server error, sorry!") end diff --git a/src/webui/routes/auth.jl b/src/webui/routes/auth.jl index 5dd511f49f..e8ab352d44 100644 --- a/src/webui/routes/auth.jl +++ b/src/webui/routes/auth.jl @@ -1,3 +1,10 @@ +# HTTP compat +if isdefined(HTTP, :stringify) + const stringify = HTTP.stringify +else + const stringify = String +end + # Step 2: Redirect to provider. function auth(r::HTTP.Request) pkey = getquery(r, "provider") @@ -16,7 +23,7 @@ function auth(r::HTTP.Request) state = String(rand('a':'z', 32)) return HTTP.Response(307, [ - "Set-Cookie" => String(HTTP.Cookie("state", state; path="/"), false), + "Set-Cookie" => stringify(HTTP.Cookie("state", state; path="/"), false), "Location" => provider.auth_url * "?" * HTTP.escapeuri(Dict( :response_type => "code", :client_id => provider.client_id, diff --git a/test/webui/gitutils.jl b/test/webui/gitutils.jl index c195278e36..71be1f46d7 100644 --- a/test/webui/gitutils.jl +++ b/test/webui/gitutils.jl @@ -1,7 +1,6 @@ using Dates: DateTime using Registrator.WebUI: isauthorized, AuthFailure, AuthSuccess, User using GitForge: GitForge, GitHub, GitLab -using HTTP: stacktrace using Mocking