Use getContentType() method instead of directly accessing the
contentType field in ResponseTrans. The method will append the charset to the content type.
This commit is contained in:
parent
0a68003361
commit
77f29e6dfd
2 changed files with 11 additions and 11 deletions
|
@ -218,12 +218,12 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
else
|
else
|
||||||
res.setHeader ("Cache-Control", "no-cache"); // for HTTP 1.1
|
res.setHeader ("Cache-Control", "no-cache"); // for HTTP 1.1
|
||||||
}
|
}
|
||||||
if ( trans.realm!=null )
|
if ( trans.realm!=null )
|
||||||
res.setHeader( "WWW-Authenticate", "Basic realm=\"" + trans.realm + "\"" );
|
res.setHeader( "WWW-Authenticate", "Basic realm=\"" + trans.realm + "\"" );
|
||||||
if (trans.status > 0)
|
if (trans.status > 0)
|
||||||
res.setStatus (trans.status);
|
res.setStatus (trans.status);
|
||||||
res.setContentLength (trans.getContentLength ());
|
res.setContentLength (trans.getContentLength ());
|
||||||
res.setContentType (trans.contentType);
|
res.setContentType (trans.getContentType ());
|
||||||
try {
|
try {
|
||||||
OutputStream out = res.getOutputStream ();
|
OutputStream out = res.getOutputStream ();
|
||||||
out.write (trans.getContent ());
|
out.write (trans.getContent ());
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class AcmeServletClient extends HttpServlet {
|
||||||
if (trans.status > 0)
|
if (trans.status > 0)
|
||||||
res.setStatus (trans.status);
|
res.setStatus (trans.status);
|
||||||
res.setContentLength (trans.getContentLength ());
|
res.setContentLength (trans.getContentLength ());
|
||||||
res.setContentType (trans.contentType);
|
res.setContentType (trans.getContentType ());
|
||||||
try {
|
try {
|
||||||
OutputStream out = res.getOutputStream ();
|
OutputStream out = res.getOutputStream ();
|
||||||
out.write (trans.getContent ());
|
out.write (trans.getContent ());
|
||||||
|
|
Loading…
Add table
Reference in a new issue