amihaiemil / docker-java-api

Lightweight Java Docker client
BSD 3-Clause "New" or "Revised" License
270 stars 53 forks source link

Let's add user-agent header #244

Closed amihaiemil closed 5 years ago

amihaiemil commented 5 years ago

We should add the User-Agent HTTP header to all our requests.

It should look like this:

User-Agent: docker-java-api / <version> See https://github.com/amihaiemil/docker-java-api

<version> should be a public static final constant, updated by Rultor on release

0crat commented 5 years ago

Job #244 is now in scope, role is DEV

0crat commented 5 years ago

Bug was reported, see §29: +15 point(s) just awarded to @amihaiemil/z

0crat commented 5 years ago

The job #244 assigned to @bkuzmic/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

amihaiemil commented 5 years ago

@bkuzmic I think we should make an HttpClient decorator for this, rather than change every single place where an HttpRequest is instantiated :D

RobertoGraham commented 5 years ago

http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/protocol/RequestDefaultHeaders.html

amihaiemil commented 5 years ago

@RobertoGraham great, thanks. I had no idea about that :)

@bkuzmic Let's use interceptors then.

RobertoGraham commented 5 years ago

I would personally do like the following on all your HttpClientBuilders, not sure how to do the Rultor version injection thing though

.addInterceptorFirst(
    new RequestDefaultHeaders(
        Collections.singletonList(
            new BasicHeader(HttpHeaders.USER_AGENT, "")
        )
    )
)
0crat commented 5 years ago

Job was finished in 46 hours, bonus for fast delivery is possible (see §36)

0crat commented 5 years ago

The job #244 is now out of scope

0crat commented 5 years ago

Order was finished: +35 point(s) just awarded to @bkuzmic/z