75 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
45c9f460b8 client: checkResponseErr: don't read body for HEAD requests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-27 12:05:26 +01:00
Sebastiaan van Stijn
e51a4306e2 client: ensureReaderClosed: small optimizations
Skip draining for HEAD requests and empty responses.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-27 12:05:26 +01:00
Sebastiaan van Stijn
4622dd0ccc client: Client.buildRequest, jsonEncode improve handling of content
- add early returns for `nil` body, `http.NoBody`, and `json.RawMessage`
- use `http.NoBody` instead of `nil` for empty bodies; it's more clear
  on intent.
- use json.Encode instead of json.Encoder.Encode(), as we're marshaling
  a single JSON document; this also avoid adding a trailing newline.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-15 00:39:59 +01:00
Sebastiaan van Stijn
20d65620f9 client: Client.buildRequest: don't set content-header if not set
This function was setting `text/plain` as default content-type for any
request that had a non-nil body.

However, this would also set the content-type if (e.g.) `http.NoBody` was set,
or if an empty reader was used, which would result in the daemon potentialy
rejecting the request, as it validates request to be using `application/json`;
d9ee22d1ab/daemon/server/httputils/httputils.go (L47-L58)

    === RUN   TestCommitInheritsEnv
        commit_test.go:30: assertion failed: error is not nil: Error response from daemon: unsupported Content-Type header (text/plain): must be 'application/json'
    --- FAIL: TestCommitInheritsEnv (0.02s)

This patch removes setting the default content-type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-15 00:39:59 +01:00
Sebastiaan van Stijn
9169ed2873 client: touch-up some godoc
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-08 13:44:39 +02:00
Sebastiaan van Stijn
3241d46525 client: Client.doRequest: adjust error matching for TLS1.3 handshake
Go 1.25 /  TLS 1.3 may produce a generic "handshake failure" whereas
TLS 1.2 may produce a "bad certificate" TLS alert.
See https://github.com/golang/go/issues/56371

> https://tip.golang.org/doc/go1.12#tls_1_3
>
> In TLS 1.3 the client is the last one to speak in the handshake, so if
> it causes an error to occur on the server, it will be returned on the
> client by the first Read, not by Handshake. For example, that will be
> the case if the server rejects the client certificate.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 10:31:43 +02:00
Sebastiaan van Stijn
f6b63e6013 client.sendRequest: clean-up logic for error-handling
Only use checkResponseErr if `client.doRequest` did not return an error;
any error returned by `client.doRequest` means there was an error connecting,
so there's no response to handle (including errors in the response).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-12 23:58:48 +02:00
Sebastiaan van Stijn
2a4f70309d client.doRequest: improve GoDoc to clarify behavior
Outline that any error returned is a connectivity error and a nil-error
requires the response to be handled (including errors returned in the
response).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-12 23:58:48 +02:00
Sebastiaan van Stijn
80294ddb60 client: make checkResponseErr a regular function
It was implemented as a method on Client, but the receiver was not used;
make it a regular function to prevent passing around the Client where
not needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-12 21:49:24 +02:00
Matthieu MOREL
96f8c6395e chore: enable use-any rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 17:07:07 +02:00
Sebastiaan van Stijn
c17d43ae67 api/types: move ErrorResponse to common/ErrorResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 14:45:10 +02:00
Sebastiaan van Stijn
bfce6556c4 client: use stdlib errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 09:11:21 +02:00
Sebastiaan van Stijn
2303e6bff6 client: Client.doRequest: add special handling for DNS resolution errors
Before this patch:

    DOCKER_HOST=tcp://example.invalid/docker docker version
    error during connect: Get "http://example.invalid:2375/docker/v1.51/version": dial tcp: lookup example.invalid: no such host

With this patch:

    DOCKER_HOST=tcp://example.invalid/docker docker version
    failed to connect to the docker API at tcp://example.invalid:2375/docker: lookup example.invalid: no such host

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-23 01:20:54 +02:00
Sebastiaan van Stijn
67596f01e2 client: Client.doRequest: add special handling for "not found" errors
Before this change, a generic "Cannot connect to the docker daemon" error
was produced which, while helpful, instructed the user to check if the daemon
was running, but didn't provide context on the reason we failed (i.e., the
socket was not found).

This patch adds a dedicated check for cases where the socket was not found,
and preserves the original error.

Before this patch:

    DOCKER_HOST=unix:///var/run/no.sock docker version
    Cannot connect to the Docker daemon at unix:///var/run/no.sock. Is the docker daemon running?

With this patch:

    DOCKER_HOST=unix:///var/run/no.sock docker version
    failed to connect to the docker API at unix:///var/run/no.sock; check if the path is correct and the daemon is running: dial unix /var/run/no.sock: connect: no such file or directory

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-23 01:20:30 +02:00
Sebastiaan van Stijn
462d0ff5aa client: Client.doRequest: simplify permission check and unwrap error
Previously, we were using os.IsPermission, which doesn't unwrap errors;
change to use `errors.Is` to detect permission errors, and unwrap the
error to remove information about the request, which is irrelevant if
we weren't able to connect in the first place.

Also tweak the error slightly to not assume "docker socket", instead
mentioning "docker API".

Before this;

    permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.51/version": dial unix /var/run/docker.sock: connect: permission denied

With this patch applied:

    permission denied while trying to connect to the docker API at unix:///var/run/docker.sock: dial unix /var/run/docker.sock: connect: permission denied

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-23 01:20:01 +02:00
Sebastiaan van Stijn
7072acac79 client: Client.doRequest: preserve wrapped error
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-23 01:19:35 +02:00
Sebastiaan van Stijn
3b4fbaacd7 client: Client.doRequest: use early return
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-23 01:19:11 +02:00
Sebastiaan van Stijn
c4f9616c4a client: cleanup encoding body and add test-coverage
This code has various other issue, for which TODOs were added; this
commit only does some initial cleaning up, and improves docs and
test-coverage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 22:51:18 +02:00
Derek McGowan
afd6487b2e Create github.com/moby/moby/api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:05 -07:00
Sebastiaan van Stijn
8c067c5223 client: Client.addHeaders: remove special handling for api < 1.25
Commit e98e4a7111 introduced functionality
to hide experimental commands, and hide commands based on API version
negotiation. Before that commit, the user-agent header was used to detect
version-mismatches between the daemon and client based on their binary
version;
3975d648b7/api/server/middleware/user_agent.go (L32-L44)

Because of the above, a check was added to prevent custom headers from
modifying the User-Agent, but given that the user-agent header changed
formatting, and api < 1.25 is long deprecated, it's not very meaningful
to add this check, so let's remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-20 18:10:04 +02:00
Sebastiaan van Stijn
4856e8ffad client: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:10 +02:00
Paweł Gronowski
a3ce441ae0 client: Use containerd errdefs to convert http errors
Previously, we were using our own `FromStatusCode` function to map HTTP
status codes to Docker error types. Switch to the containerd code.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-21 11:41:23 +02:00
Paweł Gronowski
df96159df0 client/request: use containerd errdefs checks
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-19 20:34:08 +02:00
Matthieu MOREL
205ba05feb fix usestdlibvars
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-15 18:24:58 +02:00
Sebastiaan van Stijn
126d4cf672 client: remove version-gate for JSON response errors
JSON errors were introduced in API 1.24, and daemons running older versions of
the API would return errors as plain-text. However, such API versions would
also send the corresponding content-type header (text/plain), so we don't
really need to make the code version-dependent; there's already fallbacks
in place to handle JSON-responses that don't use the expected format, in
which case we produce a generic status-code error.

Before this patch, the client would print JSON-responses as-is when the
daemon returned an "API version too old" error;

    DOCKER_API_VERSION=v1.10 docker info --format '{{.ID}}'
    Error response from daemon: {"message":"client version 1.10 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version"}

With this patch, the client detects that the response is JSON, and prints
a friendlier error-message to help the user discover their client is too
old;

    DOCKER_API_VERSION=v1.10 docker info --format '{{.ID}}'
    Error response from daemon: client version 1.10 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-20 20:25:11 +01:00
Sebastiaan van Stijn
72c91e378d client: remove serverResponse and use http.Response directly
Looking in history to learn why this struct existed, shows that this type
was mostly the result of tech-debt accumulating over time;

- originally ([moby@1aa7f13]) most of the request handling was internal;
  the [`call()` function][1] would make a request, read the `response.Body`,
  and return it as a `[]byte` (or an error if one happened).
- some features needed the statuscode, so [moby@a4bcf7e] added an extra
  output variable to return the `response.StatusCode`.
- some new features required streaming, so [moby@fdd8d4b] changed the
  function to return the `response.Body` as a `io.ReadCloser`, instead
  of a `[]byte`.
- some features needed access to the content-type header, so a new
  `clientRequest` method was introduced in [moby@6b2eeaf] to read the
  `Content-Type` header from `response.Headers` and return it as a string.
- of course, `Content-Type` may not be the only header needed, so [moby@0cdc3b7]
  changed the signature to return `response.Headers` as a whole as a
  `http.Header`
- things became a bit unwieldy now, with the function having four (4) output
  variables, so [moby@126529c] chose to refactor this code, introducing a
  `serverResponse` struct to wrap them all, not realizing that all these
  values were effectively deconstructed from the `url.Response`, so now
  re-assembling them into our own "URL response", only preserving a subset
  of the information available.
- now that we had a custom struct, it was possible to add more information
  to it without changing the signature. When there was a need to know the
  URL of the request that initiated the response, [moby@27ef09a] introduced
  a `reqURL` field to hold the `request.URL` which notably also is available
  in `response.Request.URL`.

In short;

- The original implementation tried to (pre-maturely) abstract the underlying
  response to provide a simplified interface.
- While initially not needed, abstracting caused relevant information from
  the response (and request) to be unavailable to callers.
- As a result, we ended up in a situation where we are deconstructing the
  original `url.Response`, only to re-assemble it into our own, custom struct
  (`serverResponsee`) with only a subset of the information preserved.

This patch removes the `serverResponse` struct, instead returning the
`url.Response` as-is, so that all information is preserved, allowing callers
to use the information they need.

There is one follow-up change to consider; commit [moby@589df17] introduced
a `ensureReaderClosed` utility. Before that commit, the response body would
be closed in a more idiomatic way through a [`defer serverResp.body.Close()`][2].
A later change in [docker/engine-api@5dd6452] added an optimization to that
utility, draining the response to allow connections to be reused. While
skipping that utility (and not draining the response) would not be a critical
issue, it may be easy to overlook that utility, and to close the response
body in the "idiomatic" way, resulting in a possible performance regression.

We need to check if that optimization is still relevant or if later changes
in Go itself already take care of this; we should also look if context
cancellation is handled correctly for these. If it's still relevant, we could

- Wrap the the `url.Response` in a custom struct ("drainCloser") to provide
  a `Close()` function handling the draining and closing; this would re-
  introduce a custom type to be returned, so perhaps not what we want.
- Wrap the `url.Response.Body` in the response returned (so, calling)
  `response.Body.Close()` would call the wrapped closer.
- Change the signature of `Client.sendRequest()` (and related) to return
  a `close()` func to handle this; doing so would more strongly encourage
  callers to close the response body.

[1]: 1aa7f1392d/commands.go (L1008-L1027)
[2]: 589df17a1a/api/client/ps.go (L84-L89)
[moby@1aa7f13]: 1aa7f1392d
[moby@a4bcf7e]: a4bcf7e1ac
[moby@fdd8d4b]: fdd8d4b7d9
[moby@6b2eeaf]: 6b2eeaf896
[moby@0cdc3b7]: 0cdc3b7539
[moby@126529c]: 126529c6d0
[moby@27ef09a]: 27ef09a46f
[moby@589df17]: 589df17a1a
[docker/engine-api@5dd6452]: 5dd6452d4d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-11 13:20:27 +01:00
Sebastiaan van Stijn
846b2272e6 client: deprecate ErrorConnectionFailed helper
This function was only used internally, and will be removed in the next release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 17:16:52 +01:00
Sebastiaan van Stijn
e93ff742e8 client: doRequest: use errors.As for error-detection
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 17:09:59 +01:00
Sebastiaan van Stijn
30e75b8396 client: improve handling of JSON error-responses with incorrect schema
Before this patch, an API response that's valid JSON, but not the right
schema would be silently discarded by the CLI. For example, due to a bug
in Docker Desktop's API proxy, the "normal" (not JSON error) response
would be returned together with a non-200 status code when using an
unsupported API version;

    curl -s -w 'STATUS: %{http_code}\n' --unix-socket /var/run/docker.sock 'http://localhost/v1.99/version'
    {"Platform":{"Name":"Docker Desktop 4.38.0 (181016)"},"Version":"","ApiVersion":"","GitCommit":"","GoVersion":"","Os":"","Arch":""}
    STATUS: 400

Before this patch, this resulted in no output being shown;

    DOCKER_API_VERSION=1.99 docker version
    Client:
     Version:           27.5.1
     API version:       1.99 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:37:19 2025
     OS/Arch:           darwin/arm64
     Context:           desktop-linux
    Error response from daemon:

With this patch, an error is generated based on the status:

    DOCKER_API_VERSION=1.99 docker version
    Client:
     Version:           27.5.1
     API version:       1.99 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:37:19 2025
     OS/Arch:           darwin/arm64
     Context:           desktop-linux
    Error response from daemon: API returned a 400 (Bad Request) but provided no error-message

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-30 22:01:13 +01:00
Sebastiaan van Stijn
e6f41e22a7 client: Client.doRequest: fix closing filehandle and reversed errors
commit 1a5dafb31e improved the error messages
produced by adding a check if the client is using as an elevated user. For
this, it attempts to open `\\.\PHYSICALDRIVE0`.

However, it looks like closing the file landed in the wrong branch of the
condition, so the file-handle would not be closed when the os.Open succeeded.

Looking further into this check, it appears the conditions were reversed;
if the check _fails_, it means the user is not running with elevated
permissions, but the check would use elevatedErr == nil.

Fix both by changing the condition to `elevatedErr != nil`.

While at it, also changing the string to use a string-literal, to reduce
the amount of escaping needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-03 10:52:15 +02:00
Sebastiaan van Stijn
9110ef1eec client: ensureReaderClosed: make linters happier
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-03 10:52:15 +02:00
Sebastiaan van Stijn
913478b428 client: doRequest: make sure we return a connection-error
This function has various errors that are returned when failing to make a
connection (due to permission issues, TLS mis-configuration, or failing to
resolve the TCP address).

The errConnectionFailed error is currently used as a special case when
processing Ping responses. The current code did not consistently treat
connection errors, and because of that could either absorb the error,
or process the empty response.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-02-23 15:13:22 +01:00
Sebastiaan van Stijn
4cc796ab93 client: Client.buildRequest: use http.NewRequestWithContext
Attach the context to the request while we're creating it, instead of
creating the context first, and adding the context later.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-09 20:30:25 +02:00
Sebastiaan van Stijn
87fff769f4 client: Client.checkResponseErr: change errorMessage to an error
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-09 20:30:25 +02:00
Sebastiaan van Stijn
2da589d454 client: return explicit "nil" for no errors, and remove nil check
- remove some intermediate variables
- explicitly return "nil" if there's no error
- remove redundant check for response-headers being nil

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-17 12:24:28 +02:00
Sebastiaan van Stijn
92975f0c11 client: define a "dummy" hostname to use for local connections
For local communications (npipe://, unix://), the hostname is not used,
but we need valid and meaningful hostname.

The current code used the client's `addr` as hostname in some cases, which
could contain the path for the unix-socket (`/var/run/docker.sock`), which
gets rejected by go1.20.6 and go1.19.11 because of a security fix for
[CVE-2023-29406 ][1], which was implemented in  https://go.dev/issue/60374.

Prior versions go Go would clean the host header, and strip slashes in the
process, but go1.20.6 and go1.19.11 no longer do, and reject the host
header.

This patch introduces a `DummyHost` const, and uses this dummy host for
cases where we don't need an actual hostname.

Before this patch (using go1.20.6):

    make GO_VERSION=1.20.6 TEST_FILTER=TestAttach test-integration
    === RUN   TestAttachWithTTY
        attach_test.go:46: assertion failed: error is not nil: http: invalid Host header
    --- FAIL: TestAttachWithTTY (0.11s)
    === RUN   TestAttachWithoutTTy
        attach_test.go:46: assertion failed: error is not nil: http: invalid Host header
    --- FAIL: TestAttachWithoutTTy (0.02s)
    FAIL

With this patch applied:

    make GO_VERSION=1.20.6 TEST_FILTER=TestAttach test-integration
    INFO: Testing against a local daemon
    === RUN   TestAttachWithTTY
    --- PASS: TestAttachWithTTY (0.12s)
    === RUN   TestAttachWithoutTTy
    --- PASS: TestAttachWithoutTTy (0.02s)
    PASS

[1]: https://github.com/advisories/GHSA-f8f7-69v5-w4vx

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-14 18:57:53 +02:00
Sebastiaan van Stijn
83477ce8d0 client: remove custom "headers" type, and use "http.Header" instead
Use http.Header, which is more descriptive on intent, and we're already
importing the package in the client. Removing the "header" type also fixes
various locations where the type was shadowed by local variables named
"headers".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-11 13:14:28 +02:00
Sebastiaan van Stijn
a6048fc792 client: add WithUserAgent() option
When constructing the client, and setting the User-Agent, care must be
taken to apply the header in the right location, as custom headers can
be set in the CLI configuration, and merging these custom headers should
not override the User-Agent header.

This patch adds a dedicated `WithUserAgent()` option, which stores the
user-agent separate from other headers, centralizing the merging of
other headers, so that other parts of the (CLI) code don't have to be
concerned with merging them in the right order.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-09 09:59:29 +02:00
Cory Snider
3ceb3810d7 client: don't marshal typed nils in request body
The internal Client request methods which accept an object as a body use
nil to signal that the request should not have a body. But it is easy to
accidentally pass a typed-nil value as the object, e.g. if the object
comes from a function argument or struct field of a concrete type. The
result is that these requests will, surprisingly, have a JSON body of
`null`. Treat typed-nil pointers the same as untyped nils for the
purposes of determining whether or not the request should include a
body.

Stop assuming that POST requests should always have a body. POST /commit
does not require a body, for example.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-05-17 14:58:12 -04:00
Sebastiaan van Stijn
10c56efa97 linting: error strings should not be capitalized (revive)
client/request.go:183:28: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
                    err = errors.Wrap(err, "In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.")
                                           ^
    client/request.go:186:28: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
                    err = errors.Wrap(err, "This error may indicate that the docker daemon is not running.")
                                           ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-04 10:15:06 +02:00
Drew Erny
240a9fcb83 Add Swarm cluster volume supports
Adds code to support Cluster Volumes in Swarm using CSI drivers.

Signed-off-by: Drew Erny <derny@mirantis.com>
2022-05-13 00:55:44 +02:00
Sebastiaan van Stijn
948c2c45bb client: use canonical names for HTTP Headers
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-06 10:49:02 +01:00
Sebastiaan van Stijn
2cff05e960 client/request.go:157:8: SA1019: err.Temporary is deprecated (staticcheck)
It's deprecated in Go 1.18:

    client/request.go:157:8: SA1019: err.Temporary is deprecated: Temporary errors are not well-defined. Most "temporary" errors are timeouts, and the few exceptions are surprising. Do not use this method. (staticcheck)
        if !err.Temporary() {
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-01-31 15:59:51 +01:00
Eng Zer Jun
c55a4ac779 refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated in Go 1.16. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-08-27 14:56:57 +08:00
Akihiro Suda
b9ad7b96bd Merge pull request #41778 from kplachkov/feature/fix_err_canceled
Fix converting status code to error canceled
2021-06-17 17:26:14 +09:00
Sebastiaan van Stijn
b92be7e297 client: S1031: unnecessary nil check around range (gosimple)
client/request.go:245:2: S1031: unnecessary nil check around range (gosimple)
        if headers != nil {
        ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 13:03:23 +02:00
Kostadin Plachkov
cd40eb89ae Fix client request error handling
Signed-off-by: Kostadin Plachkov <k.n.plachkov@gmail.com>
2021-05-29 01:06:58 +02:00
Evgeniy Makhrov
8ccb46a521 Check for context error that is wrapped in url.Error
Signed-off-by: Evgeniy Makhrov <e.makhrov@corp.badoo.com>
2020-08-03 15:59:22 +03:00
Sebastiaan van Stijn
dabc7cdb56 client: use constants for http methods
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-13 17:30:21 +02:00
Kir Kolyshkin
6392e765ac client: remove put()
Apparently it is not used anywhere

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-09-18 12:57:20 +02:00