1 16 17 package org.mortbay.http.handler; 18 19 import java.io.IOException ; 20 21 import org.apache.commons.logging.Log; 22 import org.mortbay.log.LogFactory; 23 import org.mortbay.http.HttpException; 24 import org.mortbay.http.HttpFields; 25 import org.mortbay.http.HttpRequest; 26 import org.mortbay.http.HttpResponse; 27 28 36 public class MsieSslHandler extends AbstractHttpHandler 37 { 38 private static Log log = LogFactory.getLog(MsieSslHandler.class); 39 40 private String userAgentSubString="MSIE 5"; 41 42 45 public void handle( 46 String pathInContext, 47 String pathParams, 48 HttpRequest request, 49 HttpResponse response) 50 throws HttpException, IOException 51 { 52 String userAgent = request.getField(HttpFields.__UserAgent); 53 54 if(userAgent != null && 55 userAgent.indexOf( userAgentSubString)>=0 && 56 HttpRequest.__SSL_SCHEME.equalsIgnoreCase(request.getScheme())) 57 { 58 if (log.isDebugEnabled()) 59 log.debug("Force close"); 60 response.setField(HttpFields.__Connection, HttpFields.__Close); 61 request.getHttpConnection().forceClose(); 62 } 63 } 64 65 68 public String getUserAgentSubString() 69 { 70 return userAgentSubString; 71 } 72 73 76 public void setUserAgentSubString(String string) 77 { 78 userAgentSubString= string; 79 } 80 81 } 82 | Popular Tags |