Skip to content

Commit 17471b8

Browse files
authored
Set AWS.jl user agent during package initialization (#743)
* Set AWS.jl user agent during package initialization * Set project version to v1.97.1
1 parent 427bba8 commit 17471b8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AWS"
22
uuid = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
33
license = "MIT"
4-
version = "1.97.0"
4+
version = "1.97.1"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/AWS.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ include("deprecated.jl")
4646
using ..AWSExceptions
4747
using ..AWSExceptions: AWSException
4848

49-
const user_agent = Ref{String}("AWS.jl/$(pkgversion(@__MODULE__()))")
49+
const user_agent = Ref{String}()
5050
const aws_config = Ref{AbstractAWSConfig}()
5151

5252
"""
@@ -469,6 +469,10 @@ function (service::ServiceWrapper)(args...; feature_set=nothing, kwargs...)
469469
end
470470

471471
function __init__()
472+
pkg_module = @__MODULE__()
473+
pkg_version = pkgversion(pkg_module)
474+
user_agent[] = "$(nameof(pkg_module)).jl/$(pkg_version)"
475+
472476
DEFAULT_BACKEND[] = HTTPBackend()
473477
return nothing
474478
end

0 commit comments

Comments
 (0)