You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2017/05/24 08:06:48 UTC
[1/9] httpcomponents-core git commit: [HTTPCORE-468]
Repository: httpcomponents-core
Updated Branches:
refs/heads/master 907d67637 -> d0b0cfab3
[HTTPCORE-468]
Allow HttpAsyncService subclasses to customize the HTTP
status code.
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/8374fec6
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/8374fec6
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/8374fec6
Branch: refs/heads/master
Commit: 8374fec658d42a321a671a8c89660d02203fe9f8
Parents: 8099ed1
Author: Gary Gregory <gg...@apache.org>
Authored: Thu May 18 16:18:16 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu May 18 16:18:16 2017 -0700
----------------------------------------------------------------------
.../hc/core5/http/impl/io/HttpService.java | 27 ++++++++++++--------
.../http/impl/nio/ServerHttp1StreamHandler.java | 14 ++++++----
2 files changed, 25 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/8374fec6/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
index b0efe13..216d1f4 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
@@ -267,23 +267,28 @@ public class HttpService {
* @param response the HTTP response.
*/
protected void handleException(final HttpException ex, final ClassicHttpResponse response) {
+ response.setCode(toStatusCode(ex, response));
+ String message = ex.getMessage();
+ if (message == null) {
+ message = ex.toString();
+ }
+ response.setEntity(new StringEntity(message, ContentType.TEXT_PLAIN));
+ }
+
+ protected int toStatusCode(final Exception ex, final ClassicHttpResponse response) {
+ final int code;
if (ex instanceof MethodNotSupportedException) {
- response.setCode(HttpStatus.SC_NOT_IMPLEMENTED);
+ code = HttpStatus.SC_NOT_IMPLEMENTED;
} else if (ex instanceof UnsupportedHttpVersionException) {
- response.setCode(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED);
+ code = HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED;
} else if (ex instanceof NotImplementedException) {
- response.setCode(HttpStatus.SC_NOT_IMPLEMENTED);
+ code = HttpStatus.SC_NOT_IMPLEMENTED;
} else if (ex instanceof ProtocolException) {
- response.setCode(HttpStatus.SC_BAD_REQUEST);
+ code = HttpStatus.SC_BAD_REQUEST;
} else {
- response.setCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
- }
- String message = ex.getMessage();
- if (message == null) {
- message = ex.toString();
+ code = HttpStatus.SC_INTERNAL_SERVER_ERROR;
}
- final StringEntity entity = new StringEntity(message, ContentType.TEXT_PLAIN);
- response.setEntity(entity);
+ return code;
}
/**
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/8374fec6/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
index 8bafa4c..7b2b698 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
@@ -206,6 +206,14 @@ class ServerHttp1StreamHandler implements ResourceHolder {
}
AsyncResponseProducer handleException(final Exception ex) {
+ String message = ex.getMessage();
+ if (message == null) {
+ message = ex.toString();
+ }
+ return new BasicResponseProducer(toStatusCode(ex), message);
+ }
+
+ protected int toStatusCode(final Exception ex) {
final int code;
if (ex instanceof MethodNotSupportedException) {
code = HttpStatus.SC_NOT_IMPLEMENTED;
@@ -218,11 +226,7 @@ class ServerHttp1StreamHandler implements ResourceHolder {
} else {
code = HttpStatus.SC_INTERNAL_SERVER_ERROR;
}
- String message = ex.getMessage();
- if (message == null) {
- message = ex.toString();
- }
- return new BasicResponseProducer(code, message);
+ return code;
}
void consumeHeader(final HttpRequest request, final boolean requestEndStream) throws HttpException, IOException {
[4/9] httpcomponents-core git commit: [HTTPCORE-468]
Posted by gg...@apache.org.
[HTTPCORE-468]
Allow HttpAsyncService subclasses to customize the HTTP
status code.
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/c96d1ada
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/c96d1ada
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/c96d1ada
Branch: refs/heads/master
Commit: c96d1adab9840c9f2cb58db1f8364c311a8ec8e6
Parents: 9ec06ec
Author: Gary Gregory <gg...@apache.org>
Authored: Thu May 18 16:18:16 2017 -0700
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri May 19 09:21:02 2017 +0200
----------------------------------------------------------------------
RELEASE_NOTES.txt | 9 +++++++
.../hc/core5/http/impl/io/HttpService.java | 27 ++++++++++++--------
.../http/impl/nio/ServerHttp1StreamHandler.java | 14 ++++++----
3 files changed, 34 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/c96d1ada/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 7c1c829..6ea30f9 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,3 +1,12 @@
+Release 5.0-ALPHA4
+-------------------
+
+Changelog
+-------------------
+
+* HTTPCORE-468: Allow HttpAsyncService subclasses to customize the HTTP status code.
+
+
Release 5.0-ALPHA3
-------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/c96d1ada/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
index b0efe13..216d1f4 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
@@ -267,23 +267,28 @@ public class HttpService {
* @param response the HTTP response.
*/
protected void handleException(final HttpException ex, final ClassicHttpResponse response) {
+ response.setCode(toStatusCode(ex, response));
+ String message = ex.getMessage();
+ if (message == null) {
+ message = ex.toString();
+ }
+ response.setEntity(new StringEntity(message, ContentType.TEXT_PLAIN));
+ }
+
+ protected int toStatusCode(final Exception ex, final ClassicHttpResponse response) {
+ final int code;
if (ex instanceof MethodNotSupportedException) {
- response.setCode(HttpStatus.SC_NOT_IMPLEMENTED);
+ code = HttpStatus.SC_NOT_IMPLEMENTED;
} else if (ex instanceof UnsupportedHttpVersionException) {
- response.setCode(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED);
+ code = HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED;
} else if (ex instanceof NotImplementedException) {
- response.setCode(HttpStatus.SC_NOT_IMPLEMENTED);
+ code = HttpStatus.SC_NOT_IMPLEMENTED;
} else if (ex instanceof ProtocolException) {
- response.setCode(HttpStatus.SC_BAD_REQUEST);
+ code = HttpStatus.SC_BAD_REQUEST;
} else {
- response.setCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
- }
- String message = ex.getMessage();
- if (message == null) {
- message = ex.toString();
+ code = HttpStatus.SC_INTERNAL_SERVER_ERROR;
}
- final StringEntity entity = new StringEntity(message, ContentType.TEXT_PLAIN);
- response.setEntity(entity);
+ return code;
}
/**
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/c96d1ada/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
index 8bafa4c..7b2b698 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
@@ -206,6 +206,14 @@ class ServerHttp1StreamHandler implements ResourceHolder {
}
AsyncResponseProducer handleException(final Exception ex) {
+ String message = ex.getMessage();
+ if (message == null) {
+ message = ex.toString();
+ }
+ return new BasicResponseProducer(toStatusCode(ex), message);
+ }
+
+ protected int toStatusCode(final Exception ex) {
final int code;
if (ex instanceof MethodNotSupportedException) {
code = HttpStatus.SC_NOT_IMPLEMENTED;
@@ -218,11 +226,7 @@ class ServerHttp1StreamHandler implements ResourceHolder {
} else {
code = HttpStatus.SC_INTERNAL_SERVER_ERROR;
}
- String message = ex.getMessage();
- if (message == null) {
- message = ex.toString();
- }
- return new BasicResponseProducer(code, message);
+ return code;
}
void consumeHeader(final HttpRequest request, final boolean requestEndStream) throws HttpException, IOException {
[2/9] httpcomponents-core git commit: Merge branch
'dev/5.0.x/HTTPCORE-468'
Posted by gg...@apache.org.
Merge branch 'dev/5.0.x/HTTPCORE-468'
[HTTPCORE-468] Allow HttpAsyncService subclasses to customize the HTTP
status code.
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/28cfcce9
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/28cfcce9
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/28cfcce9
Branch: refs/heads/master
Commit: 28cfcce90ac732b1f6a4d5d7176330c89d628ed3
Parents: 9ec06ec 8374fec
Author: Gary Gregory <gg...@apache.org>
Authored: Thu May 18 16:27:03 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu May 18 16:27:03 2017 -0700
----------------------------------------------------------------------
RELEASE_NOTES.txt | 9 +++++++
.../hc/core5/http/impl/io/HttpService.java | 27 ++++++++++++--------
.../http/impl/nio/ServerHttp1StreamHandler.java | 14 ++++++----
3 files changed, 34 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/28cfcce9/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --cc RELEASE_NOTES.txt
index 7c1c829,7c1c829..6ea30f9
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@@ -1,3 -1,3 +1,12 @@@
++Release 5.0-ALPHA4
++-------------------
++
++Changelog
++-------------------
++
++* HTTPCORE-468: Allow HttpAsyncService subclasses to customize the HTTP status code.
++
++
Release 5.0-ALPHA3
-------------------
[8/9] httpcomponents-core git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/httpcomponents-core.git
Posted by gg...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/httpcomponents-core.git
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/c30d6087
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/c30d6087
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/c30d6087
Branch: refs/heads/master
Commit: c30d608750043ed8bc33d253eabe1c616f38c639
Parents: 173d842 907d676
Author: Gary Gregory <gg...@apache.org>
Authored: Sat May 20 09:44:00 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Sat May 20 09:44:00 2017 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[7/9] httpcomponents-core git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/httpcomponents-core.git
Posted by gg...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/httpcomponents-core.git
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/173d8422
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/173d8422
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/173d8422
Branch: refs/heads/master
Commit: 173d8422e1687b0be5e725d3ec80a52d0c7ae901
Parents: 47c02ac 33d26c3
Author: Gary Gregory <gg...@apache.org>
Authored: Fri May 19 19:40:21 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri May 19 19:40:21 2017 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[6/9] httpcomponents-core git commit: [HTTPCLIENT-1852] Add APIs
URIBuilder.localhost() loopbackAddress() and setHost(InetAddress).
Posted by gg...@apache.org.
[HTTPCLIENT-1852] Add APIs URIBuilder.localhost() loopbackAddress() and
setHost(InetAddress).
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/47c02ac6
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/47c02ac6
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/47c02ac6
Branch: refs/heads/master
Commit: 47c02ac661dbf15d29ca66ee5019fae920d61965
Parents: 4195288
Author: Gary Gregory <gg...@apache.org>
Authored: Fri May 19 19:40:10 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri May 19 19:40:10 2017 -0700
----------------------------------------------------------------------
.../org/apache/hc/core5/net/URIBuilder.java | 32 +++++++++++
.../org/apache/hc/core5/net/TestURIBuilder.java | 57 +++++++++++++++++++-
2 files changed, 88 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/47c02ac6/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java b/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
index fa103dd..19dce56 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
@@ -26,8 +26,10 @@
*/
package org.apache.hc.core5.net;
+import java.net.InetAddress;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.UnknownHostException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
@@ -45,6 +47,24 @@ import org.apache.hc.core5.util.TextUtils;
*/
public class URIBuilder {
+ /**
+ * Creates a new builder for the host {@link InetAddress#getLocalHost()}.
+ *
+ * @since 4.6
+ */
+ public static URIBuilder localhost() throws UnknownHostException {
+ return new URIBuilder().setHost(InetAddress.getLocalHost());
+ }
+
+ /**
+ * Creates a new builder for the host {@link InetAddress#getLoopbackAddress()}.
+ *
+ * @since 5.0
+ */
+ public static URIBuilder loopbackAddress() {
+ return new URIBuilder().setHost(InetAddress.getLoopbackAddress());
+ }
+
private String scheme;
private String encodedSchemeSpecificPart;
private String encodedAuthority;
@@ -247,6 +267,18 @@ public class URIBuilder {
/**
* Sets URI host.
+ *
+ * @since 4.6
+ */
+ public URIBuilder setHost(final InetAddress host) {
+ this.host = host.getHostAddress();
+ this.encodedSchemeSpecificPart = null;
+ this.encodedAuthority = null;
+ return this;
+ }
+
+ /**
+ * Sets URI host.
*/
public URIBuilder setHost(final String host) {
this.host = host;
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/47c02ac6/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java b/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
index b1fa091..2929f55 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
@@ -26,6 +26,7 @@
*/
package org.apache.hc.core5.net;
+import java.net.InetAddress;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.Charset;
@@ -51,7 +52,7 @@ public class TestURIBuilder {
@Test
public void testMutationToRelativeUri() throws Exception {
final URI uri = new URI("http://stuff@localhost:80/stuff?param=stuff#fragment");
- final URIBuilder uribuilder = new URIBuilder(uri).setHost(null);
+ final URIBuilder uribuilder = new URIBuilder(uri).setHost((String) null);
final URI result = uribuilder.build();
Assert.assertEquals(new URI("http:///stuff?param=stuff#fragment"), result);
}
@@ -99,6 +100,60 @@ public class TestURIBuilder {
}
@Test
+ public void testLocalhost() throws Exception {
+ // Check that the URI generated by URI builder agrees with that generated by using URI directly
+ final String scheme="https";
+ final InetAddress host=InetAddress.getLocalHost();
+ final String specials="/abcd!$&*()_-+.,=:;'~@[]?<>|#^%\"{}\\\u00a3`\u00ac\u00a6xyz"; // N.B. excludes space
+ final URI uri = new URI(scheme, specials, host.getHostAddress(), 80, specials, specials, specials);
+
+ final URI bld = URIBuilder.localhost()
+ .setScheme(scheme)
+ .setUserInfo(specials)
+ .setPath(specials)
+ .setCustomQuery(specials)
+ .setFragment(specials)
+ .build();
+
+ Assert.assertEquals(uri.getHost(), bld.getHost());
+
+ Assert.assertEquals(uri.getUserInfo(), bld.getUserInfo());
+
+ Assert.assertEquals(uri.getPath(), bld.getPath());
+
+ Assert.assertEquals(uri.getQuery(), bld.getQuery());
+
+ Assert.assertEquals(uri.getFragment(), bld.getFragment());
+ }
+
+ @Test
+ public void testLoopbackAddress() throws Exception {
+ // Check that the URI generated by URI builder agrees with that generated by using URI directly
+ final String scheme="https";
+ final InetAddress host=InetAddress.getLoopbackAddress();
+ final String specials="/abcd!$&*()_-+.,=:;'~@[]?<>|#^%\"{}\\\u00a3`\u00ac\u00a6xyz"; // N.B. excludes space
+ final URI uri = new URI(scheme, specials, host.getHostAddress(), 80, specials, specials, specials);
+
+ final URI bld = URIBuilder.loopbackAddress()
+ .setScheme(scheme)
+ .setUserInfo(specials)
+ .setPath(specials)
+ .setCustomQuery(specials)
+ .setFragment(specials)
+ .build();
+
+ Assert.assertEquals(uri.getHost(), bld.getHost());
+
+ Assert.assertEquals(uri.getUserInfo(), bld.getUserInfo());
+
+ Assert.assertEquals(uri.getPath(), bld.getPath());
+
+ Assert.assertEquals(uri.getQuery(), bld.getQuery());
+
+ Assert.assertEquals(uri.getFragment(), bld.getFragment());
+ }
+
+ @Test
public void testEmpty() throws Exception {
final URIBuilder uribuilder = new URIBuilder();
final URI result = uribuilder.build();
[9/9] httpcomponents-core git commit: HTTPCORE-471: Add APIs
URIBuilder.localhost() and setHost(InetAddress)
Posted by gg...@apache.org.
HTTPCORE-471: Add APIs URIBuilder.localhost() and setHost(InetAddress)
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/d0b0cfab
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/d0b0cfab
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/d0b0cfab
Branch: refs/heads/master
Commit: d0b0cfab3504bc27c2628a057353491de1d27615
Parents: c30d608
Author: Gary Gregory <gg...@apache.org>
Authored: Wed May 24 01:00:19 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed May 24 01:00:19 2017 -0700
----------------------------------------------------------------------
RELEASE_NOTES.txt | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d0b0cfab/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 6ea30f9..06cab72 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -5,6 +5,10 @@ Changelog
-------------------
* HTTPCORE-468: Allow HttpAsyncService subclasses to customize the HTTP status code.
+ Contributed by Gary Gregory <ggregory at apache.org>
+
+* HTTPCORE-471: Add APIs URIBuilder.localhost() and setHost(InetAddress)
+ Contributed by Gary Gregory <ggregory at apache.org>
Release 5.0-ALPHA3
[3/9] httpcomponents-core git commit: Fix typos in examples.
Posted by gg...@apache.org.
Fix typos in examples.
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/4195288e
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/4195288e
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/4195288e
Branch: refs/heads/master
Commit: 4195288ed5756d64843473be87a49f15398463dc
Parents: 28cfcce
Author: Gary Gregory <gg...@apache.org>
Authored: Thu May 18 17:06:13 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu May 18 17:06:13 2017 -0700
----------------------------------------------------------------------
.../org/apache/hc/core5/http/examples/AsyncFileServerExample.java | 2 +-
.../apache/hc/core5/http/examples/ClassicFileServerExample.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/4195288e/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java b/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
index 610c959..b6d74ab 100644
--- a/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
+++ b/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
@@ -151,7 +151,7 @@ public class AsyncFileServerExample {
System.out.println("File " + file.getPath() + " not found");
responseTrigger.submitResponse(new BasicResponseProducer(
HttpStatus.SC_NOT_FOUND,
- "<html><body><h1>File" + file.getPath() +
+ "<html><body><h1>File " + file.getPath() +
" not found</h1></body></html>",
ContentType.TEXT_HTML));
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/4195288e/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java b/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
index 1720658..4706bfc 100644
--- a/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
+++ b/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
@@ -162,7 +162,7 @@ public class ClassicFileServerExample {
response.setCode(HttpStatus.SC_NOT_FOUND);
StringEntity outgoingEntity = new StringEntity(
- "<html><body><h1>File" + file.getPath() +
+ "<html><body><h1>File " + file.getPath() +
" not found</h1></body></html>",
ContentType.create("text/html", "UTF-8"));
response.setEntity(outgoingEntity);
[5/9] httpcomponents-core git commit: Fix typos in examples.
Posted by gg...@apache.org.
Fix typos in examples.
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/33d26c3c
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/33d26c3c
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/33d26c3c
Branch: refs/heads/master
Commit: 33d26c3c2a05286682905991d63f6bb51d6bea8d
Parents: c96d1ad
Author: Gary Gregory <gg...@apache.org>
Authored: Thu May 18 17:06:13 2017 -0700
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri May 19 09:21:29 2017 +0200
----------------------------------------------------------------------
.../org/apache/hc/core5/http/examples/AsyncFileServerExample.java | 2 +-
.../apache/hc/core5/http/examples/ClassicFileServerExample.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/33d26c3c/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java b/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
index 610c959..b6d74ab 100644
--- a/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
+++ b/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
@@ -151,7 +151,7 @@ public class AsyncFileServerExample {
System.out.println("File " + file.getPath() + " not found");
responseTrigger.submitResponse(new BasicResponseProducer(
HttpStatus.SC_NOT_FOUND,
- "<html><body><h1>File" + file.getPath() +
+ "<html><body><h1>File " + file.getPath() +
" not found</h1></body></html>",
ContentType.TEXT_HTML));
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/33d26c3c/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java b/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
index 1720658..4706bfc 100644
--- a/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
+++ b/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
@@ -162,7 +162,7 @@ public class ClassicFileServerExample {
response.setCode(HttpStatus.SC_NOT_FOUND);
StringEntity outgoingEntity = new StringEntity(
- "<html><body><h1>File" + file.getPath() +
+ "<html><body><h1>File " + file.getPath() +
" not found</h1></body></html>",
ContentType.create("text/html", "UTF-8"));
response.setEntity(outgoingEntity);