Request message copy optimization
This commit is contained in:
parent
17fce4112c
commit
e6a7fe8a0c
|
@ -46,13 +46,13 @@ public final class RequestCopier implements MessageCopier<HttpRequest> {
|
|||
if (original == null) {
|
||||
return null;
|
||||
}
|
||||
final BasicHttpRequest copy = new BasicHttpRequest(original.getMethod(), original.getPath());
|
||||
final BasicHttpRequest copy = new BasicHttpRequest(original.getMethod(), null, original.getPath());
|
||||
copy.setScheme(original.getScheme());
|
||||
copy.setAuthority(original.getAuthority());
|
||||
copy.setVersion(original.getVersion());
|
||||
for (final Iterator<Header> it = original.headerIterator(); it.hasNext(); ) {
|
||||
copy.addHeader(it.next());
|
||||
}
|
||||
copy.setScheme(original.getScheme());
|
||||
copy.setAuthority(original.getAuthority());
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,13 +47,13 @@ public final class ClassicRequestCopier implements MessageCopier<ClassicHttpRequ
|
|||
if (original == null) {
|
||||
return null;
|
||||
}
|
||||
final BasicClassicHttpRequest copy = new BasicClassicHttpRequest(original.getMethod(), original.getPath());
|
||||
final BasicClassicHttpRequest copy = new BasicClassicHttpRequest(original.getMethod(), null, original.getPath());
|
||||
copy.setScheme(original.getScheme());
|
||||
copy.setAuthority(original.getAuthority());
|
||||
copy.setVersion(original.getVersion());
|
||||
for (final Iterator<Header> it = original.headerIterator(); it.hasNext(); ) {
|
||||
copy.addHeader(it.next());
|
||||
}
|
||||
copy.setScheme(original.getScheme());
|
||||
copy.setAuthority(original.getAuthority());
|
||||
copy.setEntity(original.getEntity());
|
||||
return copy;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue