DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23708>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23708

DefaultHttpParamsFactory violates applet sandbox

           Summary: DefaultHttpParamsFactory violates applet sandbox
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HttpClient
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The DefaultHttpParamsFactory in nightly build 20031009 makes two calls to 
System.getProperties().  This is by default verboten in an applet.  I have 
patched the source to catch the security exceptions and set the properties to a 
default value.  My modified code block follows:

        // TODO: To be removed. Provided for backward compatibility
        try {
          String agent = System.getProperties().getProperty
("httpclient.useragent");
          if (agent != null) {
            params.setParameter(HttpMethodParams.USER_AGENT, agent);
          }
        }
        catch (SecurityException dontCare) { }

        // TODO: To be removed. Provided for backward compatibility
        try {
          String preemptiveDefault = System.getProperties()
              .getProperty("httpclient.authentication.preemptive");
          if (preemptiveDefault != null) {
            preemptiveDefault = preemptiveDefault.trim().toLowerCase();
            if (preemptiveDefault.equals("true")) {
              params.setParameter
(HttpClientParams.PREEMPTIVE_AUTHENTICATION, "on");
            }
            else if (preemptiveDefault.equals("false")) {
              params.setParameter
(HttpClientParams.PREEMPTIVE_AUTHENTICATION, "off");
            }
          }
        }
        catch(SecurityException dontCare) { }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to