epik: add User-Agent (#2290)
This commit is contained in:
parent
85b5ef459a
commit
748e4c0d70
4 changed files with 9 additions and 3 deletions
|
@ -60,7 +60,7 @@ More information [here]({{% ref "dns#configuration-and-credentials" %}}).
|
||||||
|
|
||||||
## More information
|
## More information
|
||||||
|
|
||||||
- [API documentation](https://docs.userapi.epik.com/v2/#/)
|
- [API documentation](https://docs-userapi.epik.com/v2/)
|
||||||
|
|
||||||
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
|
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
|
||||||
<!-- providers/dns/epik/epik.toml -->
|
<!-- providers/dns/epik/epik.toml -->
|
||||||
|
|
|
@ -41,7 +41,7 @@ GLOBAL OPTIONS:
|
||||||
--dns value Solve a DNS-01 challenge using the specified provider. Can be mixed with other types of challenges. Run 'lego dnshelp' for help on usage.
|
--dns value Solve a DNS-01 challenge using the specified provider. Can be mixed with other types of challenges. Run 'lego dnshelp' for help on usage.
|
||||||
--dns.disable-cp (deprecated) use dns.propagation-disable-ans instead. (default: false)
|
--dns.disable-cp (deprecated) use dns.propagation-disable-ans instead. (default: false)
|
||||||
--dns.propagation-disable-ans By setting this flag to true, disables the need to await propagation of the TXT record to all authoritative name servers. (default: false)
|
--dns.propagation-disable-ans By setting this flag to true, disables the need to await propagation of the TXT record to all authoritative name servers. (default: false)
|
||||||
--dns.propagation-rns By setting this flag, use all the recursive nameservers to check the propagation of the TXT record. (default: false)
|
--dns.propagation-rns By setting this flag to true, use all the recursive nameservers to check the propagation of the TXT record. (default: false)
|
||||||
--dns.propagation-wait value By setting this flag, disables all the propagation checks of the TXT record and uses a wait duration instead. (default: 0s)
|
--dns.propagation-wait value By setting this flag, disables all the propagation checks of the TXT record and uses a wait duration instead. (default: 0s)
|
||||||
--dns.resolvers value [ --dns.resolvers value ] Set the resolvers to use for performing (recursive) CNAME resolving and apex domain determination. For DNS-01 challenge verification, the authoritative DNS server is queried directly. Supported: host:port. The default is to use the system resolvers, or Google's DNS resolvers if the system's cannot be determined.
|
--dns.resolvers value [ --dns.resolvers value ] Set the resolvers to use for performing (recursive) CNAME resolving and apex domain determination. For DNS-01 challenge verification, the authoritative DNS server is queried directly. Supported: host:port. The default is to use the system resolvers, or Google's DNS resolvers if the system's cannot be determined.
|
||||||
--http-timeout value Set the HTTP timeout value to a specific value in seconds. (default: 0)
|
--http-timeout value Set the HTTP timeout value to a specific value in seconds. (default: 0)
|
||||||
|
|
|
@ -19,4 +19,4 @@ lego --email you@example.com --dns epik --domains my.example.org run
|
||||||
EPIK_HTTP_TIMEOUT = "API request timeout"
|
EPIK_HTTP_TIMEOUT = "API request timeout"
|
||||||
|
|
||||||
[Links]
|
[Links]
|
||||||
API = "https://docs.userapi.epik.com/v2/#/"
|
API = "https://docs-userapi.epik.com/v2/"
|
||||||
|
|
|
@ -15,6 +15,10 @@ import (
|
||||||
|
|
||||||
const defaultBaseURL = "https://usersapiv2.epik.com/v2"
|
const defaultBaseURL = "https://usersapiv2.epik.com/v2"
|
||||||
|
|
||||||
|
// The API server don't support User-Agent starting with `go-`, then this User-Agent is different from the other implementation.
|
||||||
|
// https://github.com/go-acme/lego/issues/2268#issuecomment-2394007004
|
||||||
|
const defaultUserAgent = "goacme/lego"
|
||||||
|
|
||||||
// Client the Epik API client.
|
// Client the Epik API client.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
signature string
|
signature string
|
||||||
|
@ -97,6 +101,8 @@ func (c Client) RemoveHostRecord(ctx context.Context, domain string, recordID st
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) do(req *http.Request, result any) error {
|
func (c Client) do(req *http.Request, result any) error {
|
||||||
|
req.Header.Set("User-Agent", defaultUserAgent)
|
||||||
|
|
||||||
resp, err := c.HTTPClient.Do(req)
|
resp, err := c.HTTPClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errutils.NewHTTPDoError(req, err)
|
return errutils.NewHTTPDoError(req, err)
|
||||||
|
|
Loading…
Reference in a new issue