From 6bd015a63e846676bbeff01fb038f7b2988e74b9 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Thu, 14 Dec 2023 16:32:27 -0700 Subject: [PATCH] Compat --- src/HTTP2.jl | 2 ++ src/client.jl | 2 -- src/utils.jl | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/HTTP2.jl b/src/HTTP2.jl index 8010c4f..55ad3bf 100644 --- a/src/HTTP2.jl +++ b/src/HTTP2.jl @@ -21,6 +21,8 @@ mutable struct Request end end +Base.getproperty(x::Request, s::Symbol) = s == :url ? x.uri : getfield(x, s) + #TODO: make a RequestMetrics that includes: # request/response body sizes # # of retries diff --git a/src/client.jl b/src/client.jl index 16ecdd0..8ae018a 100644 --- a/src/client.jl +++ b/src/client.jl @@ -408,8 +408,6 @@ function request(req::Request; if ret != 0 # NOTE: we're manually creating an AWSError here because calling aws_error # doesn't return anything useful, even though from the source code it should? - # we're also not seeing any logs from retry strategy code, so it seems like something - # isn't working quite right with the integration there ctx.error = CapturedException(AWSError("scheduling retry failed: $(ctx.request.uri.host)"), Base.backtrace()) @goto error_fail end diff --git a/src/utils.jl b/src/utils.jl index 232d83d..4495a77 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -37,6 +37,9 @@ function deleteheader(h, k) return end +removeheader(h, k) = deleteheader(h, k) +isbytes(x) = x isa AbstractVector{UInt8} || x isa AbstractString + resource(uri::URI) = string( isempty(uri.path) ? "/" : uri.path, !isempty(uri.query) ? "?" : "", uri.query, !isempty(uri.fragment) ? "#" : "", uri.fragment)