Hessian service exporter sets content type "application/x-hessian" (SPR-5621)
This commit is contained in:
parent
aa8bd6313b
commit
eabad33aa2
|
|
@ -54,6 +54,9 @@ import org.springframework.util.CommonsLogWriter;
|
||||||
*/
|
*/
|
||||||
public class HessianExporter extends RemoteExporter implements InitializingBean {
|
public class HessianExporter extends RemoteExporter implements InitializingBean {
|
||||||
|
|
||||||
|
public static final String CONTENT_TYPE_HESSIAN = "application/x-hessian";
|
||||||
|
|
||||||
|
|
||||||
private SerializerFactory serializerFactory = new SerializerFactory();
|
private SerializerFactory serializerFactory = new SerializerFactory();
|
||||||
|
|
||||||
private Log debugLogger;
|
private Log debugLogger;
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ public class HessianServiceExporter extends HessianExporter implements HttpReque
|
||||||
new String[] {"POST"}, "HessianServiceExporter only supports POST requests");
|
new String[] {"POST"}, "HessianServiceExporter only supports POST requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response.setContentType(CONTENT_TYPE_HESSIAN);
|
||||||
try {
|
try {
|
||||||
invoke(request.getInputStream(), response.getOutputStream());
|
invoke(request.getInputStream(), response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public class SimpleHessianServiceExporter extends HessianExporter implements Htt
|
||||||
throw new IOException("Hessian skeleton invocation failed", ex);
|
throw new IOException("Hessian skeleton invocation failed", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exchange.getResponseHeaders().set("Content-Type", CONTENT_TYPE_HESSIAN);
|
||||||
exchange.sendResponseHeaders(200, output.size());
|
exchange.sendResponseHeaders(200, output.size());
|
||||||
FileCopyUtils.copy(output.toByteArray(), exchange.getResponseBody());
|
FileCopyUtils.copy(output.toByteArray(), exchange.getResponseBody());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue