Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 38DD7200C30 for ; Tue, 21 Feb 2017 00:12:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3777B160B76; Mon, 20 Feb 2017 23:12:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7FC35160B73 for ; Tue, 21 Feb 2017 00:12:25 +0100 (CET) Received: (qmail 92966 invoked by uid 500); 20 Feb 2017 23:12:24 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 92954 invoked by uid 99); 20 Feb 2017 23:12:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2017 23:12:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EA8D71881A2 for ; Mon, 20 Feb 2017 23:12:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4BY07Xgnt-CE for ; Mon, 20 Feb 2017 23:12:22 +0000 (UTC) Received: from mail-ot0-f182.google.com (mail-ot0-f182.google.com [74.125.82.182]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D211B5FC2A for ; Mon, 20 Feb 2017 23:12:21 +0000 (UTC) Received: by mail-ot0-f182.google.com with SMTP id x10so38440224otb.1 for ; Mon, 20 Feb 2017 15:12:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=tUZlF9DmYYTXdPkky1GczF7amhUqJfcdqr8Y3XMbdhI=; b=CQTrJtn0i6PfIFTwGXgKAPNJawnhmLg9oqi4pX3yM9cfyoauCB4RQsVnQH7oPEIJE1 iQIw7RFxEKlW+aa7c/lOiL92TpU8ivjSk/qQkGgVGs1x3Yh+M9Ugq74a2wu/JsohUhj+ /45SHbD1MOcrABwhCTvs+ezIvdvid5fRUoYXfJnnczSKivHZaOfnucf1pPapC0kx9NK0 F+pdko3+QxeAtE84FMlpwr5w7S9U3l9M0WT7Q6k8LInH/QjRmIrlK7lYeP1ifiAGbKNa /o33Ho3944n68Jvjws4E/wehDlR9EsEEhdWwKY+VxKBHmqL2+FQs9yiBpAt37fKe3Oj5 2ZyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=tUZlF9DmYYTXdPkky1GczF7amhUqJfcdqr8Y3XMbdhI=; b=DYcDBLZyiqVqBUcOruu9Ait/qKsoXHnpzqIo7mPeRlymBpI9W9Yn18ZJoCdtN/qfwJ 5cwlmTCtH1avUQndcdeh1++ph1g/vYG7fqSQ0vC1Zfy5/tCiyzVQBfN2mE//v+FVxh7l MlbBKxUi1jTAn+h+4zMdbdqrN6iXPjDKgSMXCcgpQcyq2UJ3zWE4EDDj4fKgAJ83jL4u tLG8jZC3YcXJIMllFy3NlVIKDgHPiOdfOPj+55MMGgNUUFyyXAEM950oI12yvc+nc+M4 r8PDGWHjwJ0fELwQdF8x5soCzlOc88S/lI99CcSwQ7HGZEw1BL08ypEdVkGR23/8PfnH ioXg== X-Gm-Message-State: AMke39kOupqfGachSsSP3S4nP0kMNyuMNxR5hrTuiX9uIiOMqwnka6wioYPas9l03lQCf3xRXIL0ZzTla4caHA== X-Received: by 10.157.24.43 with SMTP id b40mr11734796ote.212.1487632341047; Mon, 20 Feb 2017 15:12:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.33.130 with HTTP; Mon, 20 Feb 2017 15:12:20 -0800 (PST) In-Reply-To: <1487411810.17642.1.camel@apache.org> References: <1487257352.28348.1.camel@apache.org> <1487328224.4745.1.camel@apache.org> <1487411810.17642.1.camel@apache.org> From: Gary Gregory Date: Mon, 20 Feb 2017 15:12:20 -0800 Message-ID: Subject: Re: User-Agent To: HttpComponents Project Content-Type: multipart/alternative; boundary=001a113724403ea2a80548fe6591 archived-at: Mon, 20 Feb 2017 23:12:26 -0000 --001a113724403ea2a80548fe6591 Content-Type: text/plain; charset=UTF-8 On Sat, Feb 18, 2017 at 1:56 AM, Oleg Kalnichevski wrote: > On Fri, 2017-02-17 at 09:38 -0800, Gary Gregory wrote: > > On Fri, Feb 17, 2017 at 2:43 AM, Oleg Kalnichevski > > wrote: > > > ... > > > > Gary > > > > > > It should be quite easy to plug in a custom protocol interceptor > > > that > > > generates a user agent header with additional runtime details. > > > However, > > > I am not sure it would really make sense to change the format used > > > by > > > default. I hope you agree. > > > > > > > Sounds OK. Any hints as to where to allow this to be plugged in > > exactly? > > > > Gary > > > > Something like that should do the job, should not it? > > --- > VersionInfo clientVersion = VersionInfo.loadVersionInfo("org.apache.http.client", > Testing.class.getClassLoader()); > VersionInfo coreVersion = VersionInfo.loadVersionInfo("org.apache.http", > Testing.class.getClassLoader()); > String javaVersion = System.getProperty("java.version"); > > String agentInfo = String.format("HttpClient/%s HttpCore/%s Java/%s)", > clientVersion.getRelease(), > coreVersion.getRelease(), > javaVersion); > > CloseableHttpClient client = HttpClientBuilder.create() > .setUserAgent(agentInfo) > .build(); > --- > Perfect! Thank you Oleg. In my version I also added the "java.vendor" property so I can see: 2017-02-20 15:10:36,390 DEBUG [main][org.apache.http.headers] http-outgoing-0 >> User-Agent: HttpClient/4.5.3 HttpCore/4.4.6 Java/Oracle Corporation 1.7.0_80) Thank you! Gary > Oleg > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > For additional commands, e-mail: dev-help@hc.apache.org > > -- E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --001a113724403ea2a80548fe6591--